Documentation ¶
Index ¶
- type CoreProvider
- func (p *CoreProvider) GetNodeMetrics(nodes ...*corev1.Node) ([]metrics.NodeMetrics, error)
- func (p *CoreProvider) GetNodeMetricsOldAPI(nodes ...string) ([]api.TimeInfo, []corev1.ResourceList, error)
- func (p *CoreProvider) GetPodMetrics(pods ...*metav1.PartialObjectMetadata) ([]metrics.PodMetrics, error)
- func (p *CoreProvider) GetPodMetricsOldAPI(pods ...apitypes.NamespacedName) ([]api.TimeInfo, [][]metrics.ContainerMetrics, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoreProvider ¶
type CoreProvider struct {
// contains filtered or unexported fields
}
CoreProvider is a provider of core metrics.
func NewCoreProvider ¶
func NewCoreProvider(translator *translator.Translator) *CoreProvider
NewCoreProvider creates a CoreProvider
func (*CoreProvider) GetNodeMetrics ¶
func (p *CoreProvider) GetNodeMetrics(nodes ...*corev1.Node) ([]metrics.NodeMetrics, error)
GetNodeMetrics implements the api.MetricsProvider interface. It translate data from getNodeMetrics to the new api.
func (*CoreProvider) GetNodeMetricsOldAPI ¶
func (p *CoreProvider) GetNodeMetricsOldAPI(nodes ...string) ([]api.TimeInfo, []corev1.ResourceList, error)
GetNodeMetricsOldAPI use old parameter lists. Making it public for testing purpose.
func (*CoreProvider) GetPodMetrics ¶
func (p *CoreProvider) GetPodMetrics(pods ...*metav1.PartialObjectMetadata) ([]metrics.PodMetrics, error)
GetPodMetrics implements the api.MetricsProvider interface. It translate data from getPodMetrics to the new api.
func (*CoreProvider) GetPodMetricsOldAPI ¶
func (p *CoreProvider) GetPodMetricsOldAPI(pods ...apitypes.NamespacedName) ([]api.TimeInfo, [][]metrics.ContainerMetrics, error)
GetPodMetricsOldAPI use old parameter lists. Making it public for testing purpose. We're wrapping this method with the new GetPodMetrics for easily re-using the old unit test and a quick merge for the vulnerability fix. In the long run it's still better to directly updating this with the new API without another layer of wrap.