From 1a1f4043dfae2e77de70d6adfbb8d84cdeed658d Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Wed, 2 Sep 2020 15:08:22 +0200 Subject: Stats APIv2 * Compatible with stats v2 API * Compatibility with stats v1 was persisted * 19.04 (legacy) dropped Change-Id: I91a3ab0c007fed6d972eee01d7caf69af29305d1 Signed-off-by: Vladimir Lavor --- core/stats.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core') diff --git a/core/stats.go b/core/stats.go index 0717be6..cd93cc1 100644 --- a/core/stats.go +++ b/core/stats.go @@ -198,6 +198,9 @@ func (c *StatsConnection) GetSystemStats(sysStats *api.SystemStats) (err error) if ss, ok := stat.Data.(adapter.SimpleCounterStat); ok { vals = make([]uint64, len(ss)) for w := range ss { + if ss[w] == nil { + continue + } vals[w] = uint64(ss[w][0]) } } -- cgit 1.2.3-korg