From 4944790e065eaa0fa851c3c46128d15d292ab735 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 1 Apr 2020 12:12:58 +0200 Subject: [PATCH] data: add support for OWE per-node statistics Gluon exports information about how many OWE capable clients are connected to a given node. The OWE client count is already contained in the wifi* counters and only provides more-specific information. --- data/statistics.go | 3 +++ data/statistics_test.go | 3 +++ data/testdata/statistics.json | 3 +++ 3 files changed, 9 insertions(+) diff --git a/data/statistics.go b/data/statistics.go index 365e3e6..bec0a7f 100644 --- a/data/statistics.go +++ b/data/statistics.go @@ -63,6 +63,9 @@ type Clients struct { Wifi uint32 `json:"wifi"` Wifi24 uint32 `json:"wifi24"` Wifi5 uint32 `json:"wifi5"` + Owe uint32 `json:"owe"` + Owe24 uint32 `json:"owe24"` + Owe5 uint32 `json:"owe5"` Total uint32 `json:"total"` } diff --git a/data/statistics_test.go b/data/statistics_test.go index 09a8bf4..ac18eb9 100644 --- a/data/statistics_test.go +++ b/data/statistics_test.go @@ -20,6 +20,9 @@ func TestStatistics(t *testing.T) { assert.Equal(uint32(35), obj.Clients.Wifi) assert.Equal(uint32(30), obj.Clients.Wifi24) assert.Equal(uint32(8), obj.Clients.Wifi5) + assert.Equal(uint32(10), obj.Clients.Owe) + assert.Equal(uint32(5), obj.Clients.Owe24) + assert.Equal(uint32(6), obj.Clients.Owe5) } func testfile(name string, obj interface{}) { diff --git a/data/testdata/statistics.json b/data/testdata/statistics.json index 51e3fac..7bd54cd 100644 --- a/data/testdata/statistics.json +++ b/data/testdata/statistics.json @@ -1,6 +1,9 @@ { "clients": { "total": 35, + "owe": 10, + "owe24": 5, + "owe5": 6, "wifi": 35, "wifi24": 30, "wifi5": 8