// GetHeapsterSelector calculates and returns HeapsterSelector that can be used to download metrics
// for this resource.
GetHeapsterSelector calculates and returns HeapsterSelector that can be used to download metrics
for this resource.
// GetHeapsterSelector calculates and returns HeapsterSelector that can be used to download metrics // for this resource .
func (self *ResourceSelector) GetHeapsterSelector(cachedPods []api.Pod) (HeapsterSelector, error) {
	summingResource, isDerivedResource := DerivedResources[self.ResourceType]
	if !isDerivedResource {
		return NewHeapsterSelectorFromNativeResource(self.ResourceType, self.Namespace, []string{self.ResourceName})
	}
	if summingResource == common.ResourceKindPod {
		myPods, err := self.getMyPodsFromCache(cachedPods)
		if err != nil {
			return HeapsterSelector{}, err
		}
		return NewHeapsterSelectorFromNativeResource(common.ResourceKindPod, self.Namespace, podListToNameList(myPods))
	} else {
		return HeapsterSelector{}, fmt.Errorf(`Internal Error: Requested summing resourceis not supported. Requested "%s"`, summingResource)
	}
}
func ( self * ResourceSelector ) GetHeapsterSelector ( cachedPods [ ] api . Pod ) ( HeapsterSelector , error ) { summingResource , isDerivedResource := DerivedResources [ self . ResourceType ] if ! isDerivedResource { return NewHeapsterSelectorFromNativeResource ( self . ResourceType , self . Namespace , [ ] string { self . ResourceName } ) } if summingResource == common . ResourceKindPod { myPods , err := self . getMyPodsFromCache ( cachedPods ) if err != nil { return HeapsterSelector { } , err } return NewHeapsterSelectorFromNativeResource ( common . ResourceKindPod , self . Namespace , podListToNameList ( myPods ) ) } else { return HeapsterSelector { } , fmt . Errorf ( `Internal Error: Requested summing resourceis not supported. Requested "%s"` , summingResource ) } }
GetHeapsterSelector calculates and returns HeapsterSelector that can be used to download metrics
for this resource.
GetHeapsterSelector calculates and returns HeapsterSelector that can be used to download metrics for this resource .
// We are dealing with derived resource. Convert derived resource to its native resources. // For example, convert deployment to the list of pod names that belong to this deployment // currently can only convert derived resource to pods. You can change it by implementing other methods