Documentation ¶
Index ¶
- Constants
- func GenerateSandboxOOMMetrics(sb *sandbox.Sandbox, c *oci.Container, oomCount uint64) []*types.Metric
- type SandboxMetrics
- type StatsServer
- func (ss *StatsServer) GenerateNetworkMetrics(sb *sandbox.Sandbox) []*types.Metric
- func (ss *StatsServer) GenerateSandboxContainerMetrics(sb *sandbox.Sandbox, c *oci.Container, sm *SandboxMetrics) *types.ContainerMetrics
- func (ss *StatsServer) MetricsForPodSandbox(sb *sandbox.Sandbox) *SandboxMetrics
- func (ss *StatsServer) MetricsForPodSandboxList(sboxes []*sandbox.Sandbox) []*SandboxMetrics
- func (ss *StatsServer) PopulateMetricDescriptors(includedKeys []string) map[string][]*types.MetricDescriptor
- func (ss *StatsServer) RemoveMetricsForPodSandbox(sb *sandbox.Sandbox)
- func (ss *StatsServer) RemoveStatsForContainer(c *oci.Container)
- func (ss *StatsServer) RemoveStatsForSandbox(sb *sandbox.Sandbox)
- func (ss *StatsServer) Shutdown()
- func (ss *StatsServer) StatsForContainer(c *oci.Container, sb *sandbox.Sandbox) *types.ContainerStats
- func (ss *StatsServer) StatsForContainers(ctrs []*oci.Container) []*types.ContainerStats
- func (ss *StatsServer) StatsForSandbox(sb *sandbox.Sandbox) *types.PodSandboxStats
- func (ss *StatsServer) StatsForSandboxes(sboxes []*sandbox.Sandbox) []*types.PodSandboxStats
Constants ¶
const NetworkMetrics = "network"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SandboxMetrics ¶ added in v1.30.0
type SandboxMetrics struct {
// contains filtered or unexported fields
}
func NewSandboxMetrics ¶ added in v1.30.0
func NewSandboxMetrics(sb *sandbox.Sandbox) *SandboxMetrics
func (*SandboxMetrics) GetMetric ¶ added in v1.30.0
func (s *SandboxMetrics) GetMetric() *types.PodSandboxMetrics
type StatsServer ¶
type StatsServer struct {
// contains filtered or unexported fields
}
StatsServer is responsible for maintaining a list of container and sandbox stats. If collectionPeriod is > 0, it maintains this list by updating the stats on collectionPeriod frequency. Otherwise, it only updates the stats as they're requested.
func New ¶
func New(ctx context.Context, cs parentServerIface) *StatsServer
New returns a new StatsServer, deriving the needed information from the provided parentServerIface.
func (*StatsServer) GenerateNetworkMetrics ¶ added in v1.30.0
func (ss *StatsServer) GenerateNetworkMetrics(sb *sandbox.Sandbox) []*types.Metric
func (*StatsServer) GenerateSandboxContainerMetrics ¶ added in v1.30.0
func (ss *StatsServer) GenerateSandboxContainerMetrics(sb *sandbox.Sandbox, c *oci.Container, sm *SandboxMetrics) *types.ContainerMetrics
GenerateSandboxContainerMetrics generates a list of metrics for the specified sandbox containers by collecting metrics from the cgroup based on the included pod metrics, except for network metrics, which are collected at the pod level.
func (*StatsServer) MetricsForPodSandbox ¶ added in v1.30.0
func (ss *StatsServer) MetricsForPodSandbox(sb *sandbox.Sandbox) *SandboxMetrics
MetricsForPodSandbox returns the metrics for the given sandbox pod/container.
func (*StatsServer) MetricsForPodSandboxList ¶ added in v1.30.0
func (ss *StatsServer) MetricsForPodSandboxList(sboxes []*sandbox.Sandbox) []*SandboxMetrics
MetricsForPodSandboxList returns the metrics for the given list of sandboxes.
func (*StatsServer) PopulateMetricDescriptors ¶ added in v1.30.0
func (ss *StatsServer) PopulateMetricDescriptors(includedKeys []string) map[string][]*types.MetricDescriptor
PopulateMetricDescriptors stores metricdescriptors statically at startup and populates the list.
func (*StatsServer) RemoveMetricsForPodSandbox ¶ added in v1.30.0
func (ss *StatsServer) RemoveMetricsForPodSandbox(sb *sandbox.Sandbox)
RemoveMetricsForPodSandbox removes the saved entry for the specified sandbox to prevent the map from always growing.
func (*StatsServer) RemoveStatsForContainer ¶
func (ss *StatsServer) RemoveStatsForContainer(c *oci.Container)
RemoveStatsForContainer removes the saved entry for the specified container to prevent the map from always growing.
func (*StatsServer) RemoveStatsForSandbox ¶
func (ss *StatsServer) RemoveStatsForSandbox(sb *sandbox.Sandbox)
RemoveStatsForSandbox removes the saved entry for the specified sandbox to prevent the map from always growing.
func (*StatsServer) Shutdown ¶
func (ss *StatsServer) Shutdown()
Shutdown tells the updateLoop to stop updating.
func (*StatsServer) StatsForContainer ¶
func (ss *StatsServer) StatsForContainer(c *oci.Container, sb *sandbox.Sandbox) *types.ContainerStats
StatsForContainer returns the stats for the given container.
func (*StatsServer) StatsForContainers ¶
func (ss *StatsServer) StatsForContainers(ctrs []*oci.Container) []*types.ContainerStats
StatsForContainers returns the stats for the given list of containers.
func (*StatsServer) StatsForSandbox ¶
func (ss *StatsServer) StatsForSandbox(sb *sandbox.Sandbox) *types.PodSandboxStats
StatsForSandbox returns the stats for the given sandbox.
func (*StatsServer) StatsForSandboxes ¶
func (ss *StatsServer) StatsForSandboxes(sboxes []*sandbox.Sandbox) []*types.PodSandboxStats
StatsForSandboxes returns the stats for the given list of sandboxes.