aboutsummaryrefslogtreecommitdiffstats
path: root/adapter/stats_api.go
AgeCommit message (Collapse)AuthorFilesLines
2022-05-05support error counters also as normal countersVladimir Lavor1-30/+9
https://gerrit.fd.io/r/c/vpp/+/35640 Signed-off-by: Vladimir Lavor <vlavor@cisco.com> Change-Id: I91820bb15655e7b309af814c659eb9f5e7cd08a4
2021-05-26statsclient: added symlinksVladimir Lavor1-4/+40
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>
2021-05-05statsclient: allow index as patternVladimir Lavor1-8/+15
* ListStats() returns stats identifiers containing the stat name and index * New method PrepareDirOnIndex(indexes...). Instead of the name filter it does not browse through all available indexes * Stats example shows how to get the last epoch value (added "e" or "epoch" command) Change-Id: Ibb15090fb0dfdb7f9b0ecf8ac07a5eb9a9ace8f8 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2021-04-20Recognize stat_dir_type_emptyVladimir Lavor1-0/+10
Do not to handle empty stats directory as unknown. Empty dir's value is always treated as zero. Change-Id: I40a3829675c5b7c9da80ceaa7e2d0a87fe02dc7c Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2021-03-03Provide error counters per worker for statsclientVladimir Lavor1-3/+11
Instead of a single value, the ErrorCounter now contains an array representing couter values per workers. Change-Id: I2b869e5b228bcb3e155b1fef08a4cd00e7d2e16a Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2021-02-23Added asynchronous connection for stats socketVladimir Lavor1-0/+1
The stats socket now allows an option to connect asynchronously in the same manner as the api socket connection. New method AsyncConnectStats returns a channel where notificaitons of type ConnectionEvent will be sent. Fixed the stats reconnect procedure which sometimes failed to re-eneable the connection. Change-Id: I0bdb19f0d57e3a1ea259b8b1ba0a5e5fa49a09db Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-03-20Fix statsclient for VPP 20.05-rc0 (master)v0.3.2Ondrej Fabry1-2/+2
- this change fixes panic that was occurring with recent VPP that was caused by incorrectly calculated vector length - converting returned vector length from uint64 to uint32 results in correct length value Change-Id: I76a4b9d147c3df3bea9d3e5ef5853e2809dc42e8 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-10-03Optimizations for statsclientOndrej Fabry1-19/+110
- this dramatically improves performance for stats data collection - memory allocation is now done only when stat dirs change - updating prepared stat dir does not need to allocate memory - created integration test for testing stats client - added NumWorkerThreads and VectorRatePerWorker to SystemStats - added ReduceSimpleCounterStatIndex, ReduceCombinedCounterStatIndex for aggregating specific index Change-Id: I702731a69024ab5dd0832bb5cfe2773a987359e5 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-07-03Fix error counters for VPP 19.04Ondrej Fabry1-5/+5
Change-Id: I87251362668bbe9a31f52c1b5e9b3ab596f7b2f3 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-06-20Add statsclient - pure Go implementation for stats APIOndrej Fabry1-0/+11
Change-Id: Ia5bab652c6089378697459f477f9060dc7a53e90 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-05-31Support for error vectorsOndrej Fabry1-1/+1
- this fixes compilation error for VPP 19.08 and keeps backwards compatibility with previous versions Change-Id: Ib58557a090caa5e8342c0cb21de8af684cb18137 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-04-11Add support for names vector and fill name in interface/node statsOndrej Fabry1-4/+14
Change-Id: I3a6bcb635701c0f00e47d04fce2113e1ac23b67b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-02-19Introduce higer-level API for retrieving statisticsOndrej Fabry1-10/+14
- see stats-api example Change-Id: I11d29d32b60d25238e75cb6b86ee34842348ab38 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-01-15added mock adapter for new VPP statsVladimir Lavor1-0/+14
Change-Id: I9d6cf28fcde79ba648321cbd92941ee7ef8e0812 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2018-10-22Introduce StatsAPI and it's initial implementationOndrej Fabry1-0/+86
- this implementation is basically Go wrapper around VPP's vppapiclient C library Change-Id: I6f53dc3e228868834bf3a8a00c686ad05e22f3dd Signed-off-by: Ondrej Fabry <ofabry@cisco.com>