coreprovider

package
v0.0.0-...-bf6d5f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL