feat: add rates stats
This commit is contained in:
parent
9c86bf4019
commit
24fc2a21f5
1 changed files with 6 additions and 0 deletions
|
@ -38,6 +38,10 @@ var (
|
|||
metricPrefix+"system_fan_rpm",
|
||||
"fan rpm",
|
||||
[]string{"id"}, nil)
|
||||
promDescConnectionRatesBytes = prometheus.NewDesc(
|
||||
metricPrefix+"connection_rates_bytes",
|
||||
"current upload/download rates in bytes/s",
|
||||
[]string{"dir"}, nil) // rx/tx
|
||||
promDescConnectionBandwidthBytes = prometheus.NewDesc(
|
||||
metricPrefix+"connection_bandwidth_bytes",
|
||||
"available upload/download bandwidth in bytes/s",
|
||||
|
@ -247,6 +251,8 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) {
|
|||
cnxIPv4 = m.IPv4
|
||||
cnxIPv6 = m.IPv6
|
||||
|
||||
c.collectCounter(ch, m.RateUp, promDescConnectionRatesBytes, "tx")
|
||||
c.collectCounter(ch, m.RateDown, promDescConnectionRatesBytes, "rx")
|
||||
c.collectGaugeWithFactor(ch, m.BandwidthUp, 1./8, promDescConnectionBandwidthBytes, "tx")
|
||||
c.collectGaugeWithFactor(ch, m.BandwidthDown, 1./8, promDescConnectionBandwidthBytes, "rx")
|
||||
c.collectCounter(ch, m.BytesUp, promDescConnectionBytes, "tx")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue