diff options
author | 2019-09-17 12:41:47 +0200 | |
---|---|---|
committer | 2019-10-03 12:54:22 +0200 | |
commit | 809b69ea4a90455445c34bbad7d8e5fea5cf3462 (patch) | |
tree | ba4b94339ac83908e2d9933692dc373929380aa7 /core/connection.go | |
parent | 48198748bdfcc7d30c794cdac19de822da53f840 (diff) |
Optimizations for statsclient
- 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>
Diffstat (limited to 'core/connection.go')
-rw-r--r-- | core/connection.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/connection.go b/core/connection.go index 8b8c7b1..6f82616 100644 --- a/core/connection.go +++ b/core/connection.go @@ -89,7 +89,6 @@ type ConnectionEvent struct { // Connection represents a shared memory connection to VPP via vppAdapter. type Connection struct { vppClient adapter.VppAPI // VPP binary API client - //statsClient adapter.StatsAPI // VPP stats API client maxAttempts int // interval for reconnect attempts recInterval time.Duration // maximum number of reconnect attempts @@ -177,7 +176,9 @@ func (c *Connection) connectVPP() error { log.Debugf("Connected to VPP") if err := c.retrieveMessageIDs(); err != nil { - c.vppClient.Disconnect() + if err := c.vppClient.Disconnect(); err != nil { + log.Debugf("disconnecting vpp client failed: %v", err) + } return fmt.Errorf("VPP is incompatible: %v", err) } @@ -192,7 +193,6 @@ func (c *Connection) Disconnect() { if c == nil { return } - if c.vppClient != nil { c.disconnectVPP() } |