convert speeds to bps
This commit is contained in:
		
							parent
							
								
									6388d32b44
								
							
						
					
					
						commit
						13b188bccb
					
				|  | @ -59,13 +59,13 @@ func descClient(ns string) *uclient { | ||||||
| 		RxBytes:        prometheus.NewDesc(ns+"receive_bytes_total", "Client Receive Bytes", labelWireless, wireless), | 		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), | 		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), | 		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), | 		Signal:         prometheus.NewDesc(ns+"radio_signal_db", "Client Signal Strength", labelWireless, wireless), | ||||||
| 		TxBytes:        prometheus.NewDesc(ns+"transmit_bytes_total", "Client Transmit Bytes", 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), | 		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), | 		TxPackets:      prometheus.NewDesc(ns+"transmit_packets_total", "Client Transmit Packets", labelWireless, wireless), | ||||||
| 		TxPower:        prometheus.NewDesc(ns+"radio_transmit_power", "Client Transmit Power", 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), | 		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), | 		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.RSSI, prometheus.GaugeValue, c.Rssi, labelWireless}, | ||||||
| 			{u.Client.Signal, prometheus.GaugeValue, c.Signal, labelWireless}, | 			{u.Client.Signal, prometheus.GaugeValue, c.Signal, labelWireless}, | ||||||
| 			{u.Client.TxPower, prometheus.GaugeValue, c.TxPower, 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.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.TxBytes, prometheus.CounterValue, c.TxBytes, labelWireless}, | ||||||
| 			{u.Client.TxBytesR, prometheus.GaugeValue, c.TxBytesR, labelWireless}, | 			{u.Client.TxBytesR, prometheus.GaugeValue, c.TxBytesR, labelWireless}, | ||||||
| 			{u.Client.TxPackets, prometheus.CounterValue, c.TxPackets, labelWireless}, | 			{u.Client.TxPackets, prometheus.CounterValue, c.TxPackets, labelWireless}, | ||||||
|  |  | ||||||
|  | @ -88,7 +88,7 @@ func descUSG(ns string) *usg { | ||||||
| 		WanRxBroadcast: prometheus.NewDesc(ns+"wan_receive_broadcast_total", "WAN Receive Broadcast Total", labelWan, nil), | 		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), | 		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), | 		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), | 		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), | 		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), | 		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.WanTxBytes, prometheus.CounterValue, wan.TxBytes, l}, | ||||||
| 			{u.USG.WanRxBroadcast, prometheus.CounterValue, wan.RxBroadcast, l}, | 			{u.USG.WanRxBroadcast, prometheus.CounterValue, wan.RxBroadcast, l}, | ||||||
| 			{u.USG.WanRxMulticast, prometheus.CounterValue, wan.RxMulticast, 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.WanTxBroadcast, prometheus.CounterValue, wan.TxBroadcast, l}, | ||||||
| 			{u.USG.WanTxBytesR, prometheus.CounterValue, wan.TxBytesR, l}, | 			{u.USG.WanTxBytesR, prometheus.CounterValue, wan.TxBytesR, l}, | ||||||
| 			{u.USG.WanTxDropped, prometheus.CounterValue, wan.TxDropped, l}, | 			{u.USG.WanTxDropped, prometheus.CounterValue, wan.TxDropped, l}, | ||||||
|  |  | ||||||
|  | @ -124,7 +124,7 @@ func descUSW(ns string) *usw { | ||||||
| 		RxMulticast:  prometheus.NewDesc(pns+"receive_multicast_total", "Total Receive Multicast", labelP, nil), | 		RxMulticast:  prometheus.NewDesc(pns+"receive_multicast_total", "Total Receive Multicast", labelP, nil), | ||||||
| 		RxPackets:    prometheus.NewDesc(pns+"receive_packets_total", "Total Receive Packets", labelP, nil), | 		RxPackets:    prometheus.NewDesc(pns+"receive_packets_total", "Total Receive Packets", labelP, nil), | ||||||
| 		Satisfaction: prometheus.NewDesc(pns+"satisfaction_percent", "Satisfaction", 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), | 		TxBroadcast:  prometheus.NewDesc(pns+"transmit_broadcast_total", "Total Transmit Broadcast", labelP, nil), | ||||||
| 		TxBytes:      prometheus.NewDesc(pns+"transmit_bytes_total", "Total Transmit Bytes", 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), | 		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.RxMulticast, prometheus.CounterValue, p.RxMulticast, l}, | ||||||
| 			{u.USW.RxPackets, prometheus.CounterValue, p.RxPackets, l}, | 			{u.USW.RxPackets, prometheus.CounterValue, p.RxPackets, l}, | ||||||
| 			{u.USW.Satisfaction, prometheus.GaugeValue, p.Satisfaction, 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.TxBroadcast, prometheus.CounterValue, p.TxBroadcast, l}, | ||||||
| 			{u.USW.TxBytes, prometheus.CounterValue, p.TxBytes, l}, | 			{u.USW.TxBytes, prometheus.CounterValue, p.TxBytes, l}, | ||||||
| 			{u.USW.TxBytesR, prometheus.GaugeValue, p.TxBytesR, l}, | 			{u.USW.TxBytesR, prometheus.GaugeValue, p.TxBytesR, l}, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue