diff options
author | Vladimir Lavor <vlavor@cisco.com> | 2021-05-13 11:15:48 +0200 |
---|---|---|
committer | Vladimir Lavor <vlavor@cisco.com> | 2021-05-26 09:53:08 +0200 |
commit | ba6e92d715c59dc71c4e18e66b262d07578d524b (patch) | |
tree | cfea5f53750b52d3eccf7bdb1947936dd7e31ee1 /adapter/statsclient/statsclient.go | |
parent | c380ee6064379258768fdfe4e9d4ad9138980ec0 (diff) |
statsclient: added symlinks
Symlink support based on https://gerrit.fd.io/r/c/vpp/+/31636
Added new stat types `CounterStat` and `CombinedCounterStat` which
represent simple/combined value of a single item (interface, node)
as a array of values by workers.
Example:
/if/names NameVector [local0 tap0 tap1]
/if/ip6 SimpleCounterVector [[0 9 0] [0 25 3] [0 0 60] [0 0 0]]
/interfaces/tap0/ip6 SimpleCounterVector [[9] [25] [0] [0]]
/interfaces/tap1/ip6 SimpleCounterVector [[0] [3] [60] [0]]
Field `Symlink` added to StatEntry to mark symlink stats.
For stats v2 only
Change-Id: Iadc825f3c42b05bfc9a91462dba8a0b0068c7cd6
Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Diffstat (limited to 'adapter/statsclient/statsclient.go')
-rw-r--r-- | adapter/statsclient/statsclient.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/adapter/statsclient/statsclient.go b/adapter/statsclient/statsclient.go index 16af16a..0b16a77 100644 --- a/adapter/statsclient/statsclient.go +++ b/adapter/statsclient/statsclient.go @@ -505,13 +505,15 @@ func (sc *StatsClient) getStatEntriesOnIndex(vector dirVector, indexes ...uint32 if len(dirName) == 0 { return } + d := sc.CopyEntryData(dirPtr, ^uint32(0)) entries = append(entries, adapter.StatEntry{ StatIdentifier: adapter.StatIdentifier{ Index: index, Name: dirName, }, - Type: adapter.StatType(dirType), - Data: sc.CopyEntryData(dirPtr), + Type: d.Type(), + Data: d, + Symlink: adapter.StatType(dirType) == adapter.Symlink, }) } return entries, nil |