From 78cf4e282a6799cce8a141cb8b2785878e77e48c Mon Sep 17 00:00:00 2001 From: David Newhall II Date: Thu, 30 May 2019 11:00:09 -0700 Subject: [PATCH] Convert rxbytes in USG to FlexInt --- core/unifi/usg_influx.go | 6 +++--- core/unifi/usg_type.go | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/unifi/usg_influx.go b/core/unifi/usg_influx.go index cd35ffc6..380b1b14 100644 --- a/core/unifi/usg_influx.go +++ b/core/unifi/usg_influx.go @@ -48,7 +48,7 @@ func (u USG) Points() ([]*influx.Point, error) { "license_state": u.LicenseState, "fw_caps": u.FwCaps, "guest-num_sta": u.GuestNumSta, - "rx_bytes": u.RxBytes, + "rx_bytes": u.RxBytes.Val, "tx_bytes": u.TxBytes, "uptime": u.Uptime, "considered_lost_at": u.ConsideredLostAt, @@ -83,7 +83,7 @@ func (u USG) Points() ([]*influx.Point, error) { "wan1_max_speed": u.Wan1.MaxSpeed, "wan1_name": u.Wan1.Name, "wan1_netmask": u.Wan1.Netmask, - "wan1_rx_bytes": u.Wan1.RxBytes, + "wan1_rx_bytes": u.Wan1.RxBytes.Val, "wan1_rx_bytes-r": u.Wan1.RxBytesR, "wan1_rx_dropped": u.Wan1.RxDropped, "wan1_rx_errors": u.Wan1.RxErrors, @@ -165,7 +165,7 @@ func (u USG) Points() ([]*influx.Point, error) { "name": p.Name, "num_sta": p.NumSta, "purpose": p.Purpose, - "rx_bytes": p.RxBytes, + "rx_bytes": p.RxBytes.Val, "rx_packets": p.RxPackets, "tx_bytes": p.TxBytes, "tx_packets": p.TxPackets, diff --git a/core/unifi/usg_type.go b/core/unifi/usg_type.go index 1dad0fca..897f5b80 100644 --- a/core/unifi/usg_type.go +++ b/core/unifi/usg_type.go @@ -65,7 +65,7 @@ type USG struct { Networkgroup string `json:"networkgroup"` NumSta float64 `json:"num_sta"` Purpose string `json:"purpose"` - RxBytes float64 `json:"rx_bytes"` + RxBytes FlexInt `json:"rx_bytes"` RxPackets float64 `json:"rx_packets"` SiteID string `json:"site_id"` TxBytes float64 `json:"tx_bytes"` @@ -100,7 +100,7 @@ type USG struct { Mac string `json:"mac"` Name string `json:"name"` Netmask string `json:"netmask"` - RxBytes float64 `json:"rx_bytes"` + RxBytes FlexInt `json:"rx_bytes"` RxDropped float64 `json:"rx_dropped"` RxErrors float64 `json:"rx_errors"` RxMulticast float64 `json:"rx_multicast"` @@ -113,7 +113,7 @@ type USG struct { Up FlexBool `json:"up"` } `json:"port_table"` Rollupgrade FlexBool `json:"rollupgrade"` - RxBytes float64 `json:"rx_bytes"` + RxBytes FlexInt `json:"rx_bytes"` Serial string `json:"serial"` SiteID string `json:"site_id"` SpeedtestStatus struct { @@ -177,7 +177,7 @@ type USG struct { Nameservers []string `json:"nameservers"` Netmask string `json:"netmask"` NumPort float64 `json:"num_port"` - RxBytes float64 `json:"rx_bytes"` + RxBytes FlexInt `json:"rx_bytes"` RxBytesR float64 `json:"rx_bytes-r"` RxDropped float64 `json:"rx_dropped"` RxErrors float64 `json:"rx_errors"` @@ -215,7 +215,7 @@ type USG struct { MaxSpeed float64 `json:"max_speed"` Name string `json:"name"` Netmask string `json:"netmask"` - RxBytes float64 `json:"rx_bytes"` + RxBytes FlexInt `json:"rx_bytes"` RxBytesR float64 `json:"rx_bytes-r"` RxDropped float64 `json:"rx_dropped"` RxErrors float64 `json:"rx_errors"` @@ -242,7 +242,7 @@ type USG struct { MaxSpeed float64 `json:"max_speed"` Name string `json:"name"` Netmask string `json:"netmask"` - RxBytes float64 `json:"rx_bytes"` + RxBytes FlexInt `json:"rx_bytes"` RxBytesR float64 `json:"rx_bytes-r"` RxDropped float64 `json:"rx_dropped"` RxErrors float64 `json:"rx_errors"`