containermetrics

package
v0.0.0-...-1f62bb7 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	TimeSpentInCPU                      time.Duration
	TimeOfSample                        time.Time
	AbsoluteCPUEntitlementInNanoseconds uint64
}

type CPUSpikeReporter

type CPUSpikeReporter struct {
	// contains filtered or unexported fields
}

func NewCPUSpikeReporter

func NewCPUSpikeReporter(metronClient loggingclient.IngressClient) *CPUSpikeReporter

func (*CPUSpikeReporter) Report

func (reporter *CPUSpikeReporter) Report(logger lager.Logger, containers []executor.Container, metrics map[string]executor.Metrics, timeStamp time.Time) error

type CachedContainerMetrics

type CachedContainerMetrics struct {
	MetricGUID       string  `json:"metric_guid"`
	CPUUsageFraction float64 `json:"cpu_usage_fraction"`
	DiskUsageBytes   uint64  `json:"disk_usage_bytes"`
	DiskQuotaBytes   uint64  `json:"disk_quota_bytes"`
	MemoryUsageBytes uint64  `json:"memory_usage_bytes"`
	MemoryQuotaBytes uint64  `json:"memory_quota_bytes"`
	RxBytes          *uint64 `json:"rx_bytes,omitempty"`
	TxBytes          *uint64 `json:"tx_bytes,omitempty"`
}

type DefaultMetricsProcessor

type DefaultMetricsProcessor struct{}

func (*DefaultMetricsProcessor) ProcessAndSend

func (p *DefaultMetricsProcessor) ProcessAndSend(
	logger lager.Logger,
	metronClient loggingclient.IngressClient,
	metricsConfig executor.MetricsConfig,
	containerMetrics executor.ContainerMetrics,
	previousInfo *CPUInfo,
	now time.Time,
) (CPUInfo, *CachedContainerMetrics)

type MetricsProcessor

type MetricsProcessor interface {
	ProcessAndSend(logger lager.Logger, metronClient loggingclient.IngressClient, metricsConfig executor.MetricsConfig, containerMetrics executor.ContainerMetrics, previousInfo *CPUInfo, now time.Time) (CPUInfo, *CachedContainerMetrics)
}

type MetricsReporter

type MetricsReporter interface {
	Report(logger lager.Logger, containers []executor.Container, metrics map[string]executor.Metrics, timeStamp time.Time) error
}

type ReportersRunner

type ReportersRunner struct {
	// contains filtered or unexported fields
}

func NewReportersRunner

func NewReportersRunner(logger lager.Logger,
	interval time.Duration,
	clock clock.Clock,
	executorClient executor.Client,
	metricsReporters ...MetricsReporter,
) *ReportersRunner

func (*ReportersRunner) Run

func (reporterRunner *ReportersRunner) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type StatsReporter

type StatsReporter struct {
	CPUInfos map[string]*CPUInfo
	// contains filtered or unexported fields
}

func NewStatsReporter

func NewStatsReporter(metronClient loggingclient.IngressClient, enableContainerProxy bool, proxyMemoryAllocation float64, metricsCache *atomic.Value) *StatsReporter

func NewStatsReporterWithProcessor

func NewStatsReporterWithProcessor(metronClient loggingclient.IngressClient, enableContainerProxy bool, proxyMemoryAllocation float64, metricsCache *atomic.Value, processor MetricsProcessor) *StatsReporter

func (*StatsReporter) Metrics

func (reporter *StatsReporter) Metrics() map[string]*CachedContainerMetrics

func (*StatsReporter) Report

func (reporter *StatsReporter) Report(logger lager.Logger, containers []executor.Container, metrics map[string]executor.Metrics, timeStamp time.Time) error

Jump to

Keyboard shortcuts

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