[TASK] Store gateway6 from gluon-package gluon-radv-filterd (fixed #30)

This commit is contained in:
Martin Geno 2017-03-06 20:18:08 +01:00
parent 12a09716fc
commit 56b14bfe60
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
3 changed files with 7 additions and 4 deletions

View File

@ -14,7 +14,8 @@ type Statistics struct {
Memory Memory `json:"memory,omitempty"`
Uptime float64 `json:"uptime,omitempty"`
Idletime float64 `json:"idletime,omitempty"`
Gateway string `json:"gateway,omitempty"`
GatewayIPv4 string `json:"gateway,omitempty"`
GatewayIPv6 string `json:"gateway6,omitempty"`
Processes struct {
Total uint32 `json:"total"`
Running uint32 `json:"running"`

View File

@ -14,7 +14,7 @@ func TestStatistics(t *testing.T) {
testfile("statistics.json", obj)
assert.Equal("f81a67a601ea", obj.NodeID)
assert.Equal("52:54:00:a9:f7:6e", obj.Gateway)
assert.Equal("52:54:00:a9:f7:6e", obj.GatewayIPv4)
assert.Equal(float64(57861871176), obj.Traffic.Rx.Bytes)
assert.Equal(uint32(35), obj.Clients.Total)
assert.Equal(uint32(35), obj.Clients.Wifi)

View File

@ -46,7 +46,8 @@ type Statistics struct {
MemoryUsage float64 `json:"memory_usage,omitempty"`
Uptime float64 `json:"uptime,omitempty"`
Idletime float64 `json:"idletime,omitempty"`
Gateway string `json:"gateway,omitempty"`
GatewayIPv4 string `json:"gateway,omitempty"`
GatewayIPv6 string `json:"gateway6,omitempty"`
Processes struct {
Total uint32 `json:"total"`
Running uint32 `json:"running"`
@ -74,7 +75,8 @@ func NewStatistics(stats *data.Statistics) *Statistics {
return &Statistics{
NodeID: stats.NodeID,
Gateway: stats.Gateway,
GatewayIPv4: stats.GatewayIPv4,
GatewayIPv6: stats.GatewayIPv6,
RootFsUsage: stats.RootFsUsage,
LoadAverage: stats.LoadAverage,
MemoryUsage: memoryUsage,