Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector collects and stores metrics history for multiple processes.
func NewCollector ¶
NewCollector creates a new Collector with a sample retention limit.
func (*Collector) AddSample ¶
func (sc *Collector) AddSample(stats ProcessStats)
AddSample records new sample.
func (*Collector) AverageCPUUsage ¶
AverageCPUUsage computes average CPU usage as a fraction of one core.
func (*Collector) AverageMemoryUsage ¶
AverageMemoryUsage returns the average stats over the given time window.
type ProcessStats ¶
type ProcessStats struct {
CPUTimeSec float64 `json:"cpu_time_sec"`
MemoryRSS uint64 `json:"memory_rss_bytes"`
}
ProcessStats stores basic stats.
Click to show internal directories.
Click to hide internal directories.