Documentation ¶
Index ¶
- Variables
- type CustomMetricsProvider
- func (c *CustomMetricsProvider) GetMetricByName(ctx context.Context, name types.NamespacedName, info provider.CustomMetricInfo, ...) (*custom_metrics.MetricValue, error)
- func (c *CustomMetricsProvider) GetMetricBySelector(ctx context.Context, namespace string, selector labels.Selector, ...) (*custom_metrics.MetricValueList, error)
- func (c *CustomMetricsProvider) ListAllMetrics() []provider.CustomMetricInfo
- type ExternalMetricsProvider
- type NodeLister
- type PodLister
- type ResourceMetricsProvider
Constants ¶
This section is empty.
Variables ¶
var ( // PodsGVR is the gvr of pods PodsGVR = corev1.SchemeGroupVersion.WithResource("pods") // NodesGVR is the gvr of nodes NodesGVR = corev1.SchemeGroupVersion.WithResource("nodes") )
Functions ¶
This section is empty.
Types ¶
type CustomMetricsProvider ¶
type CustomMetricsProvider struct {
// contains filtered or unexported fields
}
CustomMetricsProvider is a custom metrics provider
func MakeCustomMetricsProvider ¶
func MakeCustomMetricsProvider(clusterLister clusterlister.ClusterLister, multiClusterDiscovery multiclient.MultiClusterDiscoveryInterface) *CustomMetricsProvider
MakeCustomMetricsProvider creates a new custom metrics provider
func (*CustomMetricsProvider) GetMetricByName ¶
func (c *CustomMetricsProvider) GetMetricByName(ctx context.Context, name types.NamespacedName, info provider.CustomMetricInfo, metricSelector labels.Selector) (*custom_metrics.MetricValue, error)
GetMetricByName will query metrics by name from member clusters and return the result
func (*CustomMetricsProvider) GetMetricBySelector ¶
func (c *CustomMetricsProvider) GetMetricBySelector(ctx context.Context, namespace string, selector labels.Selector, info provider.CustomMetricInfo, metricSelector labels.Selector) (*custom_metrics.MetricValueList, error)
GetMetricBySelector will query metrics by selector from member clusters and return the result
func (*CustomMetricsProvider) ListAllMetrics ¶
func (c *CustomMetricsProvider) ListAllMetrics() []provider.CustomMetricInfo
ListAllMetrics returns all metrics in all member clusters
type ExternalMetricsProvider ¶
type ExternalMetricsProvider struct { }
ExternalMetricsProvider is a custom metrics provider
func MakeExternalMetricsProvider ¶
func MakeExternalMetricsProvider() *ExternalMetricsProvider
MakeExternalMetricsProvider creates a new custom metrics provider
func (*ExternalMetricsProvider) GetExternalMetric ¶
func (c *ExternalMetricsProvider) GetExternalMetric(_ context.Context, _ string, _ labels.Selector, _ provider.ExternalMetricInfo) (*external_metrics.ExternalMetricValueList, error)
GetExternalMetric will query metrics by selector from member clusters and return the result
func (*ExternalMetricsProvider) ListAllExternalMetrics ¶
func (c *ExternalMetricsProvider) ListAllExternalMetrics() []provider.ExternalMetricInfo
ListAllExternalMetrics returns all metrics in all member clusters
type NodeLister ¶
type NodeLister struct {
// contains filtered or unexported fields
}
NodeLister is an internal lister for nodes
func NewNodeLister ¶
func NewNodeLister(clusterLister clusterlister.ClusterLister, informerManager genericmanager.MultiClusterInformerManager) *NodeLister
NewNodeLister creates an internal new NodeLister
type PodLister ¶
type PodLister struct {
// contains filtered or unexported fields
}
PodLister is an internal lister for pods
func NewPodLister ¶
func NewPodLister(clusterLister clusterlister.ClusterLister, informerManager genericmanager.MultiClusterInformerManager) *PodLister
NewPodLister creates an internal new PodLister
func (*PodLister) ByNamespace ¶
func (p *PodLister) ByNamespace(namespace string) cache.GenericNamespaceLister
ByNamespace returns the pod lister with namespace info
type ResourceMetricsProvider ¶
type ResourceMetricsProvider struct { PodLister *PodLister NodeLister *NodeLister // contains filtered or unexported fields }
ResourceMetricsProvider is a resource metrics provider, to provide cpu/memory metrics
func NewResourceMetricsProvider ¶
func NewResourceMetricsProvider(clusterLister clusterlister.ClusterLister, informerManager genericmanager.MultiClusterInformerManager) *ResourceMetricsProvider
NewResourceMetricsProvider creates a new resource metrics provider
func (*ResourceMetricsProvider) GetNodeMetrics ¶
func (r *ResourceMetricsProvider) GetNodeMetrics(nodes ...*corev1.Node) ([]metrics.NodeMetrics, error)
GetNodeMetrics queries metrics by the internal constructed node
func (*ResourceMetricsProvider) GetPodMetrics ¶
func (r *ResourceMetricsProvider) GetPodMetrics(pods ...*metav1.PartialObjectMetadata) ([]metrics.PodMetrics, error)
GetPodMetrics queries metrics by the internal constructed pod