Documentation
¶
Overview ¶
internal/monitoring/collector.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUMetrics ¶
type CPUMetrics struct {
UsagePercent float64 `json:"usage_percent"`
SystemCPU uint64 `json:"system_cpu"`
OnlineCPUs int `json:"online_cpus"`
}
CPUMetrics represents CPU usage metrics
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector collects metrics from containers
func NewCollector ¶
NewCollector creates a new metrics collector
func (*Collector) GetMetrics ¶
GetMetrics returns current metrics for all services
func (*Collector) GetServiceMetrics ¶
GetServiceMetrics returns metrics for a specific service
type DiskMetrics ¶
type DiskMetrics struct {
ReadBytes uint64 `json:"read_bytes"`
WriteBytes uint64 `json:"write_bytes"`
ReadOps uint64 `json:"read_ops"`
WriteOps uint64 `json:"write_ops"`
}
DiskMetrics represents disk usage metrics
type MemoryMetrics ¶
type MemoryMetrics struct {
Usage uint64 `json:"usage"`
Limit uint64 `json:"limit"`
Percent float64 `json:"percent"`
Cache uint64 `json:"cache"`
WorkingSet uint64 `json:"working_set"`
}
MemoryMetrics represents memory usage metrics
type Metrics ¶
type Metrics struct {
Service string `json:"service"`
ContainerID string `json:"container_id"`
Timestamp time.Time `json:"timestamp"`
CPU CPUMetrics `json:"cpu"`
Memory MemoryMetrics `json:"memory"`
Network NetworkMetrics `json:"network"`
Disk DiskMetrics `json:"disk"`
Performance map[string]interface{} `json:"performance,omitempty"`
}
Metrics represents collected metrics for a service
type NetworkMetrics ¶
type NetworkMetrics struct {
RxBytes uint64 `json:"rx_bytes"`
TxBytes uint64 `json:"tx_bytes"`
RxPackets uint64 `json:"rx_packets"`
TxPackets uint64 `json:"tx_packets"`
RxDropped uint64 `json:"rx_dropped"`
TxDropped uint64 `json:"tx_dropped"`
}
NetworkMetrics represents network I/O metrics
type PerformanceHandler ¶
PerformanceHandler is a function that collects performance metrics for a specific service
Click to show internal directories.
Click to hide internal directories.