[TASK] Store gateway6 from gluon-package gluon-radv-filterd (fixed #30)
This commit is contained in:
parent
12a09716fc
commit
56b14bfe60
|
@ -14,7 +14,8 @@ type Statistics struct {
|
||||||
Memory Memory `json:"memory,omitempty"`
|
Memory Memory `json:"memory,omitempty"`
|
||||||
Uptime float64 `json:"uptime,omitempty"`
|
Uptime float64 `json:"uptime,omitempty"`
|
||||||
Idletime float64 `json:"idletime,omitempty"`
|
Idletime float64 `json:"idletime,omitempty"`
|
||||||
Gateway string `json:"gateway,omitempty"`
|
GatewayIPv4 string `json:"gateway,omitempty"`
|
||||||
|
GatewayIPv6 string `json:"gateway6,omitempty"`
|
||||||
Processes struct {
|
Processes struct {
|
||||||
Total uint32 `json:"total"`
|
Total uint32 `json:"total"`
|
||||||
Running uint32 `json:"running"`
|
Running uint32 `json:"running"`
|
||||||
|
|
|
@ -14,7 +14,7 @@ func TestStatistics(t *testing.T) {
|
||||||
testfile("statistics.json", obj)
|
testfile("statistics.json", obj)
|
||||||
|
|
||||||
assert.Equal("f81a67a601ea", obj.NodeID)
|
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(float64(57861871176), obj.Traffic.Rx.Bytes)
|
||||||
assert.Equal(uint32(35), obj.Clients.Total)
|
assert.Equal(uint32(35), obj.Clients.Total)
|
||||||
assert.Equal(uint32(35), obj.Clients.Wifi)
|
assert.Equal(uint32(35), obj.Clients.Wifi)
|
||||||
|
|
|
@ -46,7 +46,8 @@ type Statistics struct {
|
||||||
MemoryUsage float64 `json:"memory_usage,omitempty"`
|
MemoryUsage float64 `json:"memory_usage,omitempty"`
|
||||||
Uptime float64 `json:"uptime,omitempty"`
|
Uptime float64 `json:"uptime,omitempty"`
|
||||||
Idletime float64 `json:"idletime,omitempty"`
|
Idletime float64 `json:"idletime,omitempty"`
|
||||||
Gateway string `json:"gateway,omitempty"`
|
GatewayIPv4 string `json:"gateway,omitempty"`
|
||||||
|
GatewayIPv6 string `json:"gateway6,omitempty"`
|
||||||
Processes struct {
|
Processes struct {
|
||||||
Total uint32 `json:"total"`
|
Total uint32 `json:"total"`
|
||||||
Running uint32 `json:"running"`
|
Running uint32 `json:"running"`
|
||||||
|
@ -74,7 +75,8 @@ func NewStatistics(stats *data.Statistics) *Statistics {
|
||||||
|
|
||||||
return &Statistics{
|
return &Statistics{
|
||||||
NodeID: stats.NodeID,
|
NodeID: stats.NodeID,
|
||||||
Gateway: stats.Gateway,
|
GatewayIPv4: stats.GatewayIPv4,
|
||||||
|
GatewayIPv6: stats.GatewayIPv6,
|
||||||
RootFsUsage: stats.RootFsUsage,
|
RootFsUsage: stats.RootFsUsage,
|
||||||
LoadAverage: stats.LoadAverage,
|
LoadAverage: stats.LoadAverage,
|
||||||
MemoryUsage: memoryUsage,
|
MemoryUsage: memoryUsage,
|
||||||
|
|
Loading…
Reference in New Issue