1 // Copyright (c) 2019 Cisco and/or its affiliates.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at:
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
17 // StatsProvider provides methods for retrieving statistics.
18 type StatsProvider interface {
19 GetSystemStats(*SystemStats) error
20 GetNodeStats(*NodeStats) error
21 GetInterfaceStats(*InterfaceStats) error
22 GetErrorStats(*ErrorStats) error
23 GetBufferStats(*BufferStats) error
26 // SystemStats represents global system statistics.
27 type SystemStats struct {
29 NumWorkerThreads uint64
30 VectorRatePerWorker []uint64
37 // NodeStats represents per node statistics.
38 type NodeStats struct {
42 // NodeCounters represents node counters.
43 type NodeCounters struct {
45 NodeName string // requires VPP 19.04+
53 // InterfaceStats represents per interface statistics.
54 type InterfaceStats struct {
55 Interfaces []InterfaceCounters
58 // InterfaceCounters represents interface counters.
59 type InterfaceCounters struct {
61 InterfaceName string // requires VPP 19.04+
63 Rx InterfaceCounterCombined
64 Tx InterfaceCounterCombined
69 RxUnicast InterfaceCounterCombined
70 RxMulticast InterfaceCounterCombined
71 RxBroadcast InterfaceCounterCombined
72 TxUnicast InterfaceCounterCombined
73 TxMulticast InterfaceCounterCombined
74 TxBroadcast InterfaceCounterCombined
85 // InterfaceCounterCombined defines combined counters for interfaces.
86 type InterfaceCounterCombined struct {
91 // ErrorStats represents statistics per error counter.
92 type ErrorStats struct {
96 // ErrorCounter represents error counter.
97 type ErrorCounter struct {
103 // BufferStats represents statistics per buffer pool.
104 type BufferStats struct {
105 Buffer map[string]BufferPool
108 // BufferPool represents buffer pool.
109 type BufferPool struct {