Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartCollector ¶
func StartCollectorWith ¶
Types ¶
type CPUInfo ¶
type CPUInfo struct {
User time.Duration // user cpu time used by the process
Sys time.Duration // system cpu time used by the process
// Linux-specific details about the CPU configuration of the process.
//
// The values are all zero if they are not known.
//
// For more details on what those values represent see:
// https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt
// https://kernel.googlesource.com/pub/scm/linux/kernel/git/glommer/memcg/+/cpu_stat/Documentation/cgroups/cpu.txt
Period time.Duration // scheduler period
Quota time.Duration // time quota in the scheduler period
}
type CollectorFunc ¶
type CollectorFunc func()
func (CollectorFunc) Collect ¶
func (f CollectorFunc) Collect()
type DelayInfo ¶
type DelayInfo struct {
CPUDelay time.Duration
BlockIODelay time.Duration
SwapInDelay time.Duration
FreePagesDelay time.Duration
}
func CollectDelayInfo ¶
type DelayMetrics ¶
type DelayMetrics struct {
CPUDelay time.Duration `metric:"cpu.delay.seconds" type:"counter"`
BlockIODelay time.Duration `metric:"blockio.delay.seconds" type:"counter"`
SwapInDelay time.Duration `metric:"swapin.delay.seconds" type:"counter"`
FreePagesDelay time.Duration `metric:"freepages.delay.seconds" type:"counter"`
// contains filtered or unexported fields
}
DelayMetrics is a metric collector that reports resource delays on processes.
func NewDelayMetrics ¶
func NewDelayMetrics() *DelayMetrics
NewDelayStats collects metrics on the current process and reports them to the default stats engine.
func NewDelayMetricsWith ¶
func NewDelayMetricsWith(eng *stats.Engine, pid int) *DelayMetrics
NewDelayStatsWith collects metrics on the process identified by pid and reports them to eng.
func (*DelayMetrics) Collect ¶
func (d *DelayMetrics) Collect()
Collect satisfies the Collector interface.
type GoMetrics ¶
type GoMetrics struct {
// contains filtered or unexported fields
}
GoMetrics is a metric collector that reports metrics from the Go runtime.
func NewGoMetrics ¶
func NewGoMetrics() *GoMetrics
NewGoMetrics creates a new collector for the Go runtime that produces metrics on the default stats engine.
func NewGoMetricsWith ¶
NewGoMetricsWith creates a new collector for the Go unrtime that producers metrics on eng.
type MemoryInfo ¶
type ProcInfo ¶
type ProcInfo struct {
CPU CPUInfo
Memory MemoryInfo
Files FileInfo
Threads ThreadInfo
}
func CollectProcInfo ¶
type ProcMetrics ¶
type ProcMetrics struct {
// contains filtered or unexported fields
}
ProcMetrics is a metric collector that reports metrics on processes.
func NewProcMetrics ¶
func NewProcMetrics() *ProcMetrics
NewProdMetrics collects metrics on the current process and reports them to the default stats engine.
func NewProcMetricsWith ¶
func NewProcMetricsWith(eng *stats.Engine, pid int) *ProcMetrics
NewProcMetricsWith collects metrics on the process identified by pid and reports them to eng.
func (*ProcMetrics) Collect ¶
func (p *ProcMetrics) Collect()
Collect satisfies the Collector interface.