From 13b188bccb163959c4d895e9f3069e6801724f80 Mon Sep 17 00:00:00 2001 From: davidnewhall2 Date: Thu, 28 Nov 2019 02:40:29 -0800 Subject: [PATCH] convert speeds to bps --- promunifi/clients.go | 8 ++++---- promunifi/usg.go | 4 ++-- promunifi/usw.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/promunifi/clients.go b/promunifi/clients.go index 6991cf29..cd78063a 100644 --- a/promunifi/clients.go +++ b/promunifi/clients.go @@ -59,13 +59,13 @@ func descClient(ns string) *uclient { RxBytes: prometheus.NewDesc(ns+"receive_bytes_total", "Client Receive Bytes", labelWireless, wireless), RxBytesR: prometheus.NewDesc(ns+"receive_rate_bytes", "Client Receive Data Rate", labelWireless, wireless), RxPackets: prometheus.NewDesc(ns+"receive_packets_total", "Client Receive Packets", labelWireless, wireless), - RxRate: prometheus.NewDesc(ns+"radio_receive_rate_mbps", "Client Receive Rate", labelWireless, wireless), + RxRate: prometheus.NewDesc(ns+"radio_receive_rate_bps", "Client Receive Rate", labelWireless, wireless), Signal: prometheus.NewDesc(ns+"radio_signal_db", "Client Signal Strength", labelWireless, wireless), TxBytes: prometheus.NewDesc(ns+"transmit_bytes_total", "Client Transmit Bytes", labelWireless, wireless), TxBytesR: prometheus.NewDesc(ns+"transmit_rate_bytes", "Client Transmit Data Rate", labelWireless, wireless), TxPackets: prometheus.NewDesc(ns+"transmit_packets_total", "Client Transmit Packets", labelWireless, wireless), TxPower: prometheus.NewDesc(ns+"radio_transmit_power", "Client Transmit Power", labelWireless, wireless), - TxRate: prometheus.NewDesc(ns+"radio_transmit_rate_mbps", "Client Transmit Rate", labelWireless, wireless), + TxRate: prometheus.NewDesc(ns+"radio_transmit_rate_bps", "Client Transmit Rate", labelWireless, wireless), WifiTxAttempts: prometheus.NewDesc(ns+"wifi_attempts_transmit_total", "Client Wifi Transmit Attempts", labelWireless, wireless), WiredRxBytes: prometheus.NewDesc(ns+"wired_receive_bytes_total", "Client Wired Receive Bytes", labelWired, wired), @@ -123,9 +123,9 @@ func (u *unifiCollector) exportClient(r *Report, c *unifi.Client) { {u.Client.RSSI, prometheus.GaugeValue, c.Rssi, labelWireless}, {u.Client.Signal, prometheus.GaugeValue, c.Signal, labelWireless}, {u.Client.TxPower, prometheus.GaugeValue, c.TxPower, labelWireless}, - {u.Client.TxRate, prometheus.GaugeValue, c.TxRate / 1000, labelWireless}, + {u.Client.TxRate, prometheus.GaugeValue, c.TxRate * 1000, labelWireless}, {u.Client.WifiTxAttempts, prometheus.CounterValue, c.WifiTxAttempts, labelWireless}, - {u.Client.RxRate, prometheus.GaugeValue, c.RxRate / 1000, labelWireless}, + {u.Client.RxRate, prometheus.GaugeValue, c.RxRate * 1000, labelWireless}, {u.Client.TxBytes, prometheus.CounterValue, c.TxBytes, labelWireless}, {u.Client.TxBytesR, prometheus.GaugeValue, c.TxBytesR, labelWireless}, {u.Client.TxPackets, prometheus.CounterValue, c.TxPackets, labelWireless}, diff --git a/promunifi/usg.go b/promunifi/usg.go index ea94aa8e..c21def5c 100644 --- a/promunifi/usg.go +++ b/promunifi/usg.go @@ -88,7 +88,7 @@ func descUSG(ns string) *usg { WanRxBroadcast: prometheus.NewDesc(ns+"wan_receive_broadcast_total", "WAN Receive Broadcast Total", labelWan, nil), WanRxBytesR: prometheus.NewDesc(ns+"wan_receive_rate_bytes", "WAN Receive Bytes Rate", labelWan, nil), WanRxMulticast: prometheus.NewDesc(ns+"wan_receive_multicast_total", "WAN Receive Multicast Total", labelWan, nil), - WanSpeed: prometheus.NewDesc(ns+"wan_speed_mbps", "WAN Speed", labelWan, nil), + WanSpeed: prometheus.NewDesc(ns+"wan_speed_bps", "WAN Speed", labelWan, nil), WanTxBroadcast: prometheus.NewDesc(ns+"wan_transmit_broadcast_total", "WAN Transmit Broadcast Total", labelWan, nil), WanTxBytesR: prometheus.NewDesc(ns+"wan_transmit_rate_bytes", "WAN Transmit Bytes Rate", labelWan, nil), WanTxDropped: prometheus.NewDesc(ns+"wan_transmit_dropped_total", "WAN Transmit Dropped Total", labelWan, nil), @@ -179,7 +179,7 @@ func (u *unifiCollector) exportWANPorts(r *Report, labels []string, wans ...unif {u.USG.WanTxBytes, prometheus.CounterValue, wan.TxBytes, l}, {u.USG.WanRxBroadcast, prometheus.CounterValue, wan.RxBroadcast, l}, {u.USG.WanRxMulticast, prometheus.CounterValue, wan.RxMulticast, l}, - {u.USG.WanSpeed, prometheus.CounterValue, wan.Speed, l}, + {u.USG.WanSpeed, prometheus.CounterValue, wan.Speed * 1000000, l}, {u.USG.WanTxBroadcast, prometheus.CounterValue, wan.TxBroadcast, l}, {u.USG.WanTxBytesR, prometheus.CounterValue, wan.TxBytesR, l}, {u.USG.WanTxDropped, prometheus.CounterValue, wan.TxDropped, l}, diff --git a/promunifi/usw.go b/promunifi/usw.go index 03d287fc..8981604a 100644 --- a/promunifi/usw.go +++ b/promunifi/usw.go @@ -124,7 +124,7 @@ func descUSW(ns string) *usw { RxMulticast: prometheus.NewDesc(pns+"receive_multicast_total", "Total Receive Multicast", labelP, nil), RxPackets: prometheus.NewDesc(pns+"receive_packets_total", "Total Receive Packets", labelP, nil), Satisfaction: prometheus.NewDesc(pns+"satisfaction_percent", "Satisfaction", labelP, nil), - Speed: prometheus.NewDesc(pns+"port_speed_mbps", "Speed", labelP, nil), + Speed: prometheus.NewDesc(pns+"port_speed_bps", "Speed", labelP, nil), TxBroadcast: prometheus.NewDesc(pns+"transmit_broadcast_total", "Total Transmit Broadcast", labelP, nil), TxBytes: prometheus.NewDesc(pns+"transmit_bytes_total", "Total Transmit Bytes", labelP, nil), TxBytesR: prometheus.NewDesc(pns+"transmit_rate_bytes", "Transmit Bytes Rate", labelP, nil), @@ -220,7 +220,7 @@ func (u *unifiCollector) exportPortTable(r *Report, pt []unifi.Port, labels []st {u.USW.RxMulticast, prometheus.CounterValue, p.RxMulticast, l}, {u.USW.RxPackets, prometheus.CounterValue, p.RxPackets, l}, {u.USW.Satisfaction, prometheus.GaugeValue, p.Satisfaction, l}, - {u.USW.Speed, prometheus.GaugeValue, p.Speed, l}, + {u.USW.Speed, prometheus.GaugeValue, p.Speed * 1000000, l}, {u.USW.TxBroadcast, prometheus.CounterValue, p.TxBroadcast, l}, {u.USW.TxBytes, prometheus.CounterValue, p.TxBytes, l}, {u.USW.TxBytesR, prometheus.GaugeValue, p.TxBytesR, l},