Embed Traffic directly into Statistics

This commit is contained in:
Julian Kornberger 2016-03-19 03:08:19 +01:00
parent 8d471d532a
commit 9c09d80da9

View File

@ -6,20 +6,26 @@ package data
*/ */
type Statistics struct { type Statistics struct {
NodeId string `json:"node_id"` NodeId string `json:"node_id"`
Clients Clients `json:"clients"` Clients Clients `json:"clients"`
RootFsUsage float64 `json:"rootfs_usage"` RootFsUsage float64 `json:"rootfs_usage"`
Traffic *Traffic `json:"traffic"` LoadAverage float64 `json:"loadavg"`
Memory Memory `json:"memory"` Memory Memory `json:"memory"`
Uptime float64 `json:"uptime"` Uptime float64 `json:"uptime"`
Idletime float64 `json:"idletime"` Idletime float64 `json:"idletime"`
Gateway string `json:"gateway"` Gateway string `json:"gateway"`
Processes struct { Processes struct {
Total uint32 `json:"total"` Total uint32 `json:"total"`
Running uint32 `json:"running"` Running uint32 `json:"running"`
} `json:"processes"` } `json:"processes"`
LoadAverage float64 `json:"loadavg"` MeshVpn *MeshVPN `json:"mesh_vpn,omitempty"`
MeshVpn *MeshVPN `json:"mesh_vpn,omitempty"` Traffic struct {
Tx *Traffic `json:"tx"`
Rx *Traffic `json:"rx"`
Forward *Traffic `json:"forward"`
MgmtTx *Traffic `json:"mgmt_tx"`
MgmtRx *Traffic `json:"mgmt_rx"`
} `json:"traffic"`
} }
type MeshVPNPeerLink struct { type MeshVPNPeerLink struct {
@ -35,20 +41,12 @@ type MeshVPN struct {
Groups map[string]*MeshVPNPeerGroup `json:"groups,omitempty"` Groups map[string]*MeshVPNPeerGroup `json:"groups,omitempty"`
} }
type TrafficEntry struct { type Traffic struct {
Bytes float64 `json:"bytes,omitempty"` Bytes float64 `json:"bytes,omitempty"`
Packets float64 `json:"packets,omitempty"` Packets float64 `json:"packets,omitempty"`
Dropped float64 `json:"dropped,omitempty"` Dropped float64 `json:"dropped,omitempty"`
} }
type Traffic struct {
Tx *TrafficEntry `json:"tx"`
Rx *TrafficEntry `json:"rx"`
Forward *TrafficEntry `json:"forward"`
MgmtTx *TrafficEntry `json:"mgmt_tx"`
MgmtRx *TrafficEntry `json:"mgmt_rx"`
}
type Clients struct { type Clients struct {
Wifi uint32 `json:"wifi"` Wifi uint32 `json:"wifi"`
Wifi24 uint32 `json:"wifi24"` Wifi24 uint32 `json:"wifi24"`