Convert txbytes in USG to FlexInt

This commit is contained in:
David Newhall II 2019-05-30 18:44:20 -07:00
parent 78cf4e282a
commit 5dd6188676
2 changed files with 9 additions and 9 deletions

View File

@ -49,7 +49,7 @@ func (u USG) Points() ([]*influx.Point, error) {
"fw_caps": u.FwCaps,
"guest-num_sta": u.GuestNumSta,
"rx_bytes": u.RxBytes.Val,
"tx_bytes": u.TxBytes,
"tx_bytes": u.TxBytes.Val,
"uptime": u.Uptime,
"considered_lost_at": u.ConsideredLostAt,
"next_heartbeat_at": u.NextHeartbeatAt,
@ -92,7 +92,7 @@ func (u USG) Points() ([]*influx.Point, error) {
"wan1_type": u.Wan1.Type,
"wan1_speed": u.Wan1.Speed,
"wan1_up": u.Wan1.Up.Val,
"wan1_tx_bytes": u.Wan1.TxBytes,
"wan1_tx_bytes": u.Wan1.TxBytes.Val,
"wan1_tx_bytes-r": u.Wan1.TxBytesR,
"wan1_tx_dropped": u.Wan1.TxDropped,
"wan1_tx_errors": u.Wan1.TxErrors,
@ -167,7 +167,7 @@ func (u USG) Points() ([]*influx.Point, error) {
"purpose": p.Purpose,
"rx_bytes": p.RxBytes.Val,
"rx_packets": p.RxPackets,
"tx_bytes": p.TxBytes,
"tx_bytes": p.TxBytes.Val,
"tx_packets": p.TxPackets,
"up": p.Up.Txt,
"vlan": p.Vlan,

View File

@ -68,7 +68,7 @@ type USG struct {
RxBytes FlexInt `json:"rx_bytes"`
RxPackets float64 `json:"rx_packets"`
SiteID string `json:"site_id"`
TxBytes float64 `json:"tx_bytes"`
TxBytes FlexInt `json:"tx_bytes"`
TxPackets float64 `json:"tx_packets"`
Up FlexBool `json:"up"`
Vlan string `json:"vlan,omitempty"`
@ -106,7 +106,7 @@ type USG struct {
RxMulticast float64 `json:"rx_multicast"`
RxPackets float64 `json:"rx_packets"`
Speed float64 `json:"speed"`
TxBytes float64 `json:"tx_bytes"`
TxBytes FlexInt `json:"tx_bytes"`
TxDropped float64 `json:"tx_dropped"`
TxErrors float64 `json:"tx_errors"`
TxPackets float64 `json:"tx_packets"`
@ -160,7 +160,7 @@ type USG struct {
Mem float64 `json:"mem,string"`
Uptime float64 `json:"uptime,string"`
} `json:"system-stats"`
TxBytes float64 `json:"tx_bytes"`
TxBytes FlexInt `json:"tx_bytes"`
Type string `json:"type"`
Upgradable FlexBool `json:"upgradable"`
Uplink struct {
@ -187,7 +187,7 @@ type USG struct {
SpeedtestLastrun float64 `json:"speedtest_lastrun"`
SpeedtestPing float64 `json:"speedtest_ping"`
SpeedtestStatus string `json:"speedtest_status"`
TxBytes float64 `json:"tx_bytes"`
TxBytes FlexInt `json:"tx_bytes"`
TxBytesR float64 `json:"tx_bytes-r"`
TxDropped float64 `json:"tx_dropped"`
TxErrors float64 `json:"tx_errors"`
@ -222,7 +222,7 @@ type USG struct {
RxMulticast float64 `json:"rx_multicast"`
RxPackets float64 `json:"rx_packets"`
Speed float64 `json:"speed"`
TxBytes float64 `json:"tx_bytes"`
TxBytes FlexInt `json:"tx_bytes"`
TxBytesR float64 `json:"tx_bytes-r"`
TxDropped float64 `json:"tx_dropped"`
TxErrors float64 `json:"tx_errors"`
@ -249,7 +249,7 @@ type USG struct {
RxMulticast float64 `json:"rx_multicast"`
RxPackets float64 `json:"rx_packets"`
Speed float64 `json:"speed"`
TxBytes float64 `json:"tx_bytes"`
TxBytes FlexInt `json:"tx_bytes"`
TxBytesR float64 `json:"tx_bytes-r"`
TxDropped float64 `json:"tx_dropped"`
TxErrors float64 `json:"tx_errors"`