containermetrics

package
v0.0.0-...-848778d Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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