cast back to int64 so existing timeseries continue to ingest, influxdb is very strict about int vs float storage
This commit is contained in:
parent
10ea30d0f4
commit
0aa406a2dc
|
|
@ -42,32 +42,32 @@ func (u *InfluxUnifi) batchClient(r report, s *unifi.Client) { // nolint: funlen
|
||||||
"hostname": s.Name,
|
"hostname": s.Name,
|
||||||
"radio_desc": s.RadioDescription,
|
"radio_desc": s.RadioDescription,
|
||||||
"satisfaction": s.Satisfaction.Val,
|
"satisfaction": s.Satisfaction.Val,
|
||||||
"bytes_r": s.BytesR,
|
"bytes_r": s.BytesR.Int64(),
|
||||||
"ccq": s.Ccq,
|
"ccq": s.Ccq.Int64(),
|
||||||
"noise": s.Noise,
|
"noise": s.Noise.Int64(),
|
||||||
"note": s.Note,
|
"note": s.Note,
|
||||||
"powersave_enabled": s.PowersaveEnabled,
|
"powersave_enabled": s.PowersaveEnabled,
|
||||||
"roam_count": s.RoamCount,
|
"roam_count": s.RoamCount.Int64(),
|
||||||
"rssi": s.Rssi,
|
"rssi": s.Rssi.Int64(),
|
||||||
"rx_bytes": s.RxBytes,
|
"rx_bytes": s.RxBytes.Int64(),
|
||||||
"rx_bytes_r": s.RxBytesR,
|
"rx_bytes_r": s.RxBytesR.Int64(),
|
||||||
"rx_packets": s.RxPackets,
|
"rx_packets": s.RxPackets.Int64(),
|
||||||
"rx_rate": s.RxRate,
|
"rx_rate": s.RxRate.Int64(),
|
||||||
"signal": s.Signal,
|
"signal": s.Signal.Int64(),
|
||||||
"tx_bytes": s.TxBytes,
|
"tx_bytes": s.TxBytes.Int64(),
|
||||||
"tx_bytes_r": s.TxBytesR,
|
"tx_bytes_r": s.TxBytesR.Int64(),
|
||||||
"tx_packets": s.TxPackets,
|
"tx_packets": s.TxPackets.Int64(),
|
||||||
"tx_retries": s.TxRetries,
|
"tx_retries": s.TxRetries,
|
||||||
"tx_power": s.TxPower,
|
"tx_power": s.TxPower.Int64(),
|
||||||
"tx_rate": s.TxRate,
|
"tx_rate": s.TxRate.Int64(),
|
||||||
"uptime": s.Uptime,
|
"uptime": s.Uptime.Int64(),
|
||||||
"wifi_tx_attempts": s.WifiTxAttempts,
|
"wifi_tx_attempts": s.WifiTxAttempts,
|
||||||
"wired-rx_bytes": s.WiredRxBytes,
|
"wired-rx_bytes": s.WiredRxBytes.Int64(),
|
||||||
"wired-rx_bytes-r": s.WiredRxBytesR,
|
"wired-rx_bytes-r": s.WiredRxBytesR.Int64(),
|
||||||
"wired-rx_packets": s.WiredRxPackets,
|
"wired-rx_packets": s.WiredRxPackets.Int64(),
|
||||||
"wired-tx_bytes": s.WiredTxBytes,
|
"wired-tx_bytes": s.WiredTxBytes.Int64(),
|
||||||
"wired-tx_bytes-r": s.WiredTxBytesR,
|
"wired-tx_bytes-r": s.WiredTxBytesR.Int64(),
|
||||||
"wired-tx_packets": s.WiredTxPackets,
|
"wired-tx_packets": s.WiredTxPackets.Int64(),
|
||||||
}
|
}
|
||||||
|
|
||||||
r.send(&metric{Table: "clients", Tags: tags, Fields: fields})
|
r.send(&metric{Table: "clients", Tags: tags, Fields: fields})
|
||||||
|
|
@ -100,10 +100,10 @@ func (u *InfluxUnifi) batchClientDPI(r report, v any, appTotal, catTotal totalsD
|
||||||
"source": s.SourceName,
|
"source": s.SourceName,
|
||||||
},
|
},
|
||||||
Fields: map[string]any{
|
Fields: map[string]any{
|
||||||
"tx_packets": dpi.TxPackets.Val,
|
"tx_packets": dpi.TxPackets.Int64(),
|
||||||
"rx_packets": dpi.RxPackets.Val,
|
"rx_packets": dpi.RxPackets.Int64(),
|
||||||
"tx_bytes": dpi.TxBytes.Val,
|
"tx_bytes": dpi.TxBytes.Int64(),
|
||||||
"rx_bytes": dpi.RxBytes.Val,
|
"rx_bytes": dpi.RxBytes.Int64(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -167,10 +167,10 @@ func reportClientDPItotals(r report, appTotal, catTotal totalsDPImap) {
|
||||||
"source": controller,
|
"source": controller,
|
||||||
},
|
},
|
||||||
Fields: map[string]any{
|
Fields: map[string]any{
|
||||||
"tx_packets": m.TxPackets.Val,
|
"tx_packets": m.TxPackets.Int64(),
|
||||||
"rx_packets": m.RxPackets.Val,
|
"rx_packets": m.RxPackets.Int64(),
|
||||||
"tx_bytes": m.TxBytes.Val,
|
"tx_bytes": m.TxBytes.Int64(),
|
||||||
"rx_bytes": m.RxBytes.Val,
|
"rx_bytes": m.RxBytes.Int64(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
newMetric.Tags[k.kind] = name
|
newMetric.Tags[k.kind] = name
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ func (u *InfluxUnifi) batchSite(r report, s *unifi.Site) {
|
||||||
"num_user": h.NumUser.Val,
|
"num_user": h.NumUser.Val,
|
||||||
"num_guest": h.NumGuest.Val,
|
"num_guest": h.NumGuest.Val,
|
||||||
"num_iot": h.NumIot.Val,
|
"num_iot": h.NumIot.Val,
|
||||||
"tx_bytes-r": h.TxBytesR.Val,
|
"tx_bytes-r": h.TxBytesR.Int64(),
|
||||||
"rx_bytes-r": h.RxBytesR.Val,
|
"rx_bytes-r": h.RxBytesR.Int64(),
|
||||||
"num_ap": h.NumAp.Val,
|
"num_ap": h.NumAp.Val,
|
||||||
"num_adopted": h.NumAdopted.Val,
|
"num_adopted": h.NumAdopted.Val,
|
||||||
"num_disabled": h.NumDisabled.Val,
|
"num_disabled": h.NumDisabled.Val,
|
||||||
|
|
@ -37,7 +37,7 @@ func (u *InfluxUnifi) batchSite(r report, s *unifi.Site) {
|
||||||
"gw_mem": h.GwSystemStats.Mem.Val,
|
"gw_mem": h.GwSystemStats.Mem.Val,
|
||||||
"gw_uptime": h.GwSystemStats.Uptime.Val,
|
"gw_uptime": h.GwSystemStats.Uptime.Val,
|
||||||
"latency": h.Latency.Val,
|
"latency": h.Latency.Val,
|
||||||
"uptime": h.Uptime.Val,
|
"uptime": h.Uptime.Int64(),
|
||||||
"drops": h.Drops.Val,
|
"drops": h.Drops.Val,
|
||||||
"xput_up": h.XputUp.Val,
|
"xput_up": h.XputUp.Val,
|
||||||
"xput_down": h.XputDown.Val,
|
"xput_down": h.XputDown.Val,
|
||||||
|
|
@ -74,10 +74,10 @@ func (u *InfluxUnifi) batchSiteDPI(r report, v any) {
|
||||||
"source": s.SourceName,
|
"source": s.SourceName,
|
||||||
},
|
},
|
||||||
Fields: map[string]any{
|
Fields: map[string]any{
|
||||||
"tx_packets": dpi.TxPackets.Val,
|
"tx_packets": dpi.TxPackets.Int64(),
|
||||||
"rx_packets": dpi.RxPackets.Val,
|
"rx_packets": dpi.RxPackets.Int64(),
|
||||||
"tx_bytes": dpi.TxBytes.Val,
|
"tx_bytes": dpi.TxBytes.Int64(),
|
||||||
"rx_bytes": dpi.RxBytes.Val,
|
"rx_bytes": dpi.RxBytes.Int64(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue