3 // SystemStats represents global system statistics.
4 type SystemStats struct {
12 // NodeStats represents per node statistics.
13 type NodeStats struct {
17 // NodeCounters represents node counters.
18 type NodeCounters struct {
20 // TODO: node name is not currently retrievable via stats API (will be most likely added in 19.04)
29 // InterfaceStats represents per interface statistics.
30 type InterfaceStats struct {
31 Interfaces []InterfaceCounters
34 // InterfaceCounters represents interface counters.
35 type InterfaceCounters struct {
37 // TODO: interface name is not currently retrievable via stats API (will be most likely added in 19.04)
38 //InterfaceName string
47 RxUnicast [2]uint64 // packets[0], bytes[1]
48 RxMulticast [2]uint64 // packets[0], bytes[1]
49 RxBroadcast [2]uint64 // packets[0], bytes[1]
50 TxUnicastMiss [2]uint64 // packets[0], bytes[1]
51 TxMulticast [2]uint64 // packets[0], bytes[1]
52 TxBroadcast [2]uint64 // packets[0], bytes[1]
62 // ErrorStats represents statistics per error counter.
63 type ErrorStats struct {
67 // ErrorCounter represents error counter.
68 type ErrorCounter struct {
73 // StatsProvider provides the methods for getting statistics.
74 type StatsProvider interface {
75 GetSystemStats() (*SystemStats, error)
76 GetNodeStats() (*NodeStats, error)
77 GetInterfaceStats() (*InterfaceStats, error)
78 GetErrorStats(names ...string) (*ErrorStats, error)