Documentation
¶
Overview ¶
Package history stores a rolling window of container resource metrics for charting. It has two interchangeable backends selected at runtime:
- in-memory ring (default, zero-config, lost on restart)
- Redis (set DC_REDIS_ADDR) — survives restarts and can be shared
The backend is chosen by Config; everything else in the app talks to the Store interface only.
Index ¶
Constants ¶
View Source
const ( MetricCPU = "cpu" MetricMem = "mem" // percent MetricMemBytes = "membytes" // bytes )
Metrics that can be queried.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
RedisAddr string // empty → in-memory
RedisPassword string
RedisDB int
Retention time.Duration // how long to keep points
}
Config selects and configures the backend.
type Sample ¶
type Sample struct {
ContainerID string
Time time.Time
CPU float64 // percent
MemPercent float64 // percent of limit
MemBytes float64 // bytes
}
Sample is one moment's resource reading for a container.
Click to show internal directories.
Click to hide internal directories.