summaryrefslogtreecommitdiffstats
path: root/adapter/statsclient/statseg_v2.go
diff options
context:
space:
mode:
authorVladimir Lavor <vlavor@cisco.com>2021-06-01 09:21:49 +0200
committerVladimir Lavor <vlavor@cisco.com>2021-06-01 16:08:39 +0200
commitda95997338b77811bc2ea850db393c652b3bd18e (patch)
tree8c1e9f58e858598de00d3c6954224d041bd6ba83 /adapter/statsclient/statseg_v2.go
parentba6e92d715c59dc71c4e18e66b262d07578d524b (diff)
statsclient: fix retrieving stats type
Signed-off-by: Vladimir Lavor <vlavor@cisco.com> Change-Id: Id51fa03ac69a2fc29aca5ff644178cdfcabe523c
Diffstat (limited to 'adapter/statsclient/statseg_v2.go')
-rw-r--r--adapter/statsclient/statseg_v2.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/adapter/statsclient/statseg_v2.go b/adapter/statsclient/statseg_v2.go
index 16f1729..0780248 100644
--- a/adapter/statsclient/statseg_v2.go
+++ b/adapter/statsclient/statseg_v2.go
@@ -92,12 +92,14 @@ func (ss *statSegmentV2) GetEpoch() (int64, bool) {
func (ss *statSegmentV2) CopyEntryData(segment dirSegment, index uint32) adapter.Stat {
dirEntry := (*statSegDirectoryEntryV2)(segment)
- if dirEntry.unionData == 0 {
- debugf("data value or pointer not defined for %s", dirEntry.name)
+ typ := adapter.StatType(dirEntry.directoryType)
+ // skip zero pointer value
+ if typ != statDirScalarIndex && typ != statDirEmpty && dirEntry.unionData == 0 {
+ debugf("data pointer not defined for %s", dirEntry.name)
return nil
}
- switch adapter.StatType(dirEntry.directoryType) {
+ switch typ {
case statDirScalarIndex:
return adapter.ScalarStat(dirEntry.unionData)