Documentation ¶
Overview ¶
Package system operates with system metrics data.
Index ¶
- type CPU
- type CPUData
- type CPUUpdater
- type DF
- type DFData
- type ExtraMetricCPU
- type ExtraMetricRAM
- type GaugeDiff
- type GaugePercent
- type IF
- type IFData
- type IfAddress
- type MEM
- type Memory
- type MetricCPU
- type MetricDF
- type MetricIF
- type MetricLoad
- type MetricRAM
- type MetricString
- type MetricStringSnapshot
- type MetricSwap
- type PSData
- type PSInfo
- type RAM
- type RAMUpdater
- type StandardMetricString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUData ¶ added in v0.6.1
type CPUData struct { N string // Pcts without "%" UserPct uint SysPct uint WaitPct uint IdlePct uint }
CPUData type is a struct of cpu metrics.
type CPUUpdater ¶ added in v0.6.1
type DFData ¶ added in v0.6.1
type DFData struct { DevName string DirName string // inodes Inodes string Iused string Ifree string IusePct uint // bytes Total string Used string Avail string UsePct uint }
DFData type is a struct of disk metrics.
type ExtraMetricCPU ¶
type ExtraMetricCPU struct { Wait *GaugePercent Irq *GaugePercent SoftIrq *GaugePercent Stolen *GaugePercent }
type ExtraMetricRAM ¶
type GaugeDiff ¶ added in v0.6.1
type GaugeDiff struct { Delta metrics.Gauge // Delta as the primary metric. Absolute metrics.Gauge // Absolute keeps the absolute value, not exported as it's registered in private registry. Previous metrics.Gauge // Previous keeps the previous absolute value, not exported as it's registered in private registry. Mutex sync.Mutex }
GaugeDiff holds two Gauge metrics: the first is the exported one. Caveat: The exported metric value is 0 initially, not "nan", until updated.
func (*GaugeDiff) DeltaValue ¶ added in v0.6.1
func (*GaugeDiff) UpdateAbsolute ¶ added in v0.6.1
type GaugePercent ¶ added in v0.6.1
type GaugePercent struct { Percent metrics.GaugeFloat64 // Percent as the primary metric. Previous metrics.Gauge Mutex sync.Mutex }
func NewGaugePercent ¶ added in v0.6.1
func NewGaugePercent(name string, r metrics.Registry) *GaugePercent
func (*GaugePercent) SnapshotValueUint ¶ added in v0.6.1
func (gp *GaugePercent) SnapshotValueUint() uint
func (*GaugePercent) UpdatePercent ¶ added in v0.6.1
func (gp *GaugePercent) UpdatePercent(totalDelta int64, uabsolute uint64)
type IFData ¶ added in v0.6.1
type IFData struct { Name string IP string BytesIn string BytesOut string DeltaBitsIn string DeltaBitsOut string DeltaBytesOutNum uint64 DropsIn string DropsOut string `json:",omitempty"` DeltaDropsIn string DeltaDropsOut string `json:",omitempty"` ErrorsIn string ErrorsOut string DeltaErrorsIn string DeltaErrorsOut string PacketsIn string PacketsOut string DeltaPacketsIn string DeltaPacketsOut string }
IFData type is a struct of interface metrics.
type MetricCPU ¶ added in v0.6.1
type MetricCPU struct { // derive from one of (go-)metric types, otherwise it won't be registered metrics.Healthcheck N string // The "cpu-N" UserPct *GaugePercent NicePct *GaugePercent SysPct *GaugePercent WaitPct *GaugePercent IdlePct *GaugePercent Total *GaugeDiff Extra CPUUpdater }
func ExtraNewMetricCPU ¶ added in v0.6.1
func ExtraNewMetricCPU(r metrics.Registry, name string, extra CPUUpdater) *MetricCPU
type MetricDF ¶ added in v0.6.1
type MetricDF struct { // derive from one of (go-)metric types, otherwise it won't be registered metrics.Healthcheck DevName MetricString Free metrics.GaugeFloat64 Reserved metrics.GaugeFloat64 Total metrics.Gauge Used metrics.GaugeFloat64 Avail metrics.Gauge UsePct metrics.GaugeFloat64 Inodes metrics.Gauge Iused metrics.Gauge Ifree metrics.Gauge IusePct metrics.GaugeFloat64 DirName MetricString }
func (*MetricDF) Update ¶ added in v0.6.1
func (md *MetricDF) Update(fs sigar.FileSystem, usage sigar.FileSystemUsage)
Update reads usage and fs and updates the corresponding fields in DF.
type MetricIF ¶ added in v0.6.1
type MetricIF struct { NewGD func(string) *GaugeDiff // internal // derive from one of (go-)metric types, otherwise it won't be registered metrics.Healthcheck Name string IP MetricString BytesIn *GaugeDiff BytesOut *GaugeDiff DropsIn *GaugeDiff DropsOut *GaugeDiff ErrorsIn *GaugeDiff ErrorsOut *GaugeDiff PacketsIn *GaugeDiff PacketsOut *GaugeDiff }
MetricIF set of interface metrics.
type MetricLoad ¶ added in v0.6.1
type MetricLoad struct { Short metrics.GaugeFloat64 Mid metrics.GaugeFloat64 Long metrics.GaugeFloat64 }
func NewMetricLoad ¶ added in v0.6.1
func NewMetricLoad(r metrics.Registry) *MetricLoad
type MetricRAM ¶ added in v0.6.1
type MetricRAM struct { Free metrics.Gauge Total metrics.Gauge Extra RAMUpdater }
func ExtraNewMetricRAM ¶ added in v0.6.1
func ExtraNewMetricRAM(r metrics.Registry, extra RAMUpdater) *MetricRAM
func NewMetricRAM ¶
type MetricString ¶ added in v0.6.1
type MetricString interface { Snapshot() MetricString Value() string Update(string) }
type MetricStringSnapshot ¶ added in v0.6.1
type MetricStringSnapshot string
func (MetricStringSnapshot) Snapshot ¶ added in v0.6.1
func (mss MetricStringSnapshot) Snapshot() MetricString
func (MetricStringSnapshot) Update ¶ added in v0.6.1
func (MetricStringSnapshot) Update(string)
func (MetricStringSnapshot) Value ¶ added in v0.6.1
func (mss MetricStringSnapshot) Value() string
type MetricSwap ¶ added in v0.6.1
func NewMetricSwap ¶ added in v0.6.1
func NewMetricSwap(r metrics.Registry) MetricSwap
func (*MetricSwap) TotalValue ¶ added in v0.6.1
func (ms *MetricSwap) TotalValue() uint64
func (*MetricSwap) Update ¶ added in v0.6.1
func (ms *MetricSwap) Update(got sigar.Swap)
type PSData ¶ added in v0.6.1
type PSData struct { PID uint UID uint Priority int Nice int Time string Name string User string Size string // with units Resident string // with units }
PSData type is a public (for index context, json marshaling) account of a process.
type PSInfo ¶ added in v0.6.1
type PSInfo struct { PID uint Priority int Nice int Time uint64 Name string UID uint Size uint64 Resident uint64 }
PSInfo type is an internal account of a process.
type RAMUpdater ¶ added in v0.6.1
type StandardMetricString ¶ added in v0.6.1
func (*StandardMetricString) Snapshot ¶ added in v0.6.1
func (sms *StandardMetricString) Snapshot() MetricString
func (*StandardMetricString) Update ¶ added in v0.6.1
func (sms *StandardMetricString) Update(new string)
func (*StandardMetricString) Value ¶ added in v0.6.1
func (sms *StandardMetricString) Value() string
Click to show internal directories.
Click to hide internal directories.