Embed Traffic directly into Statistics

This commit is contained in:
Julian Kornberger 2016-03-19 03:08:19 +01:00
parent 8d471d532a
commit 9c09d80da9
1 changed files with 17 additions and 19 deletions

View File

@ -9,7 +9,7 @@ type Statistics struct {
NodeId string `json:"node_id"`
Clients Clients `json:"clients"`
RootFsUsage float64 `json:"rootfs_usage"`
Traffic *Traffic `json:"traffic"`
LoadAverage float64 `json:"loadavg"`
Memory Memory `json:"memory"`
Uptime float64 `json:"uptime"`
Idletime float64 `json:"idletime"`
@ -18,8 +18,14 @@ type Statistics struct {
Total uint32 `json:"total"`
Running uint32 `json:"running"`
} `json:"processes"`
LoadAverage float64 `json:"loadavg"`
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 {
@ -35,20 +41,12 @@ type MeshVPN struct {
Groups map[string]*MeshVPNPeerGroup `json:"groups,omitempty"`
}
type TrafficEntry struct {
type Traffic struct {
Bytes float64 `json:"bytes,omitempty"`
Packets float64 `json:"packets,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 {
Wifi uint32 `json:"wifi"`
Wifi24 uint32 `json:"wifi24"`