Documentation ¶
Overview ¶
Package metrics provides general system and process level metrics collection.
Index ¶
Constants ¶
const DashboardEnabledFlag = "dashboard"
const MetricsEnabledFlag = "metrics"
MetricsEnabledFlag is the CLI flag name to use to enable metrics collections.
Variables ¶
var Enabled = false
Enabled is the flag specifying if metrics are enable or not.
Functions ¶
func CollectProcessMetrics ¶ added in v0.9.39
CollectProcessMetrics periodically collects various metrics about the running process.
func NewCounter ¶ added in v1.5.0
func NewCounter(name string) metrics.Counter
NewCounter create a new metrics Counter, either a real one of a NOP stub depending on the metrics flag.
func NewMeter ¶ added in v0.9.39
func NewMeter(name string) metrics.Meter
NewMeter create a new metrics Meter, either a real one of a NOP stub depending on the metrics flag.
func NewTimer ¶ added in v0.9.39
func NewTimer(name string) metrics.Timer
NewTimer create a new metrics Timer, either a real one of a NOP stub depending on the metrics flag.
func ReadDiskStats ¶ added in v0.9.39
ReadDiskStats retrieves the disk IO stats belonging to the current process.
Types ¶
type DiskStats ¶ added in v0.9.39
type DiskStats struct { ReadCount int64 // Number of read operations executed ReadBytes int64 // Total number of bytes read WriteCount int64 // Number of write operations executed WriteBytes int64 // Total number of byte written }
DiskStats is the per process disk io stats.