Codebase list golang-procfs / 5162bec
Merge pull request #374 from treydock/ib-counters Add several Infiniband counters Ben Kochie authored 3 years ago GitHub committed 3 years ago
2 changed file(s) with 94 addition(s) and 80 deletion(s). Raw diff Collapse all Expand all
4141 LegacyPortXmitData64 *uint64 // counters_ext/port_xmit_data_64
4242 LegacyPortXmitPackets64 *uint64 // counters_ext/port_xmit_packets_64
4343
44 LinkDowned *uint64 // counters/link_downed
45 LinkErrorRecovery *uint64 // counters/link_error_recovery
46 MulticastRcvPackets *uint64 // counters/multicast_rcv_packets
47 MulticastXmitPackets *uint64 // counters/multicast_xmit_packets
48 PortRcvConstraintErrors *uint64 // counters/port_rcv_constraint_errors
49 PortRcvData *uint64 // counters/port_rcv_data
50 PortRcvDiscards *uint64 // counters/port_rcv_discards
51 PortRcvErrors *uint64 // counters/port_rcv_errors
52 PortRcvPackets *uint64 // counters/port_rcv_packets
53 PortRcvRemotePhysicalErrors *uint64 // counters/port_rcv_remote_physical_errors
54 PortRcvSwitchRelayErrors *uint64 // counters/port_rcv_switch_relay_errors
55 PortXmitConstraintErrors *uint64 // counters/port_xmit_constraint_errors
56 PortXmitData *uint64 // counters/port_xmit_data
57 PortXmitDiscards *uint64 // counters/port_xmit_discards
58 PortXmitPackets *uint64 // counters/port_xmit_packets
59 PortXmitWait *uint64 // counters/port_xmit_wait
60 SymbolError *uint64 // counters/symbol_error
61 UnicastRcvPackets *uint64 // counters/unicast_rcv_packets
62 UnicastXmitPackets *uint64 // counters/unicast_xmit_packets
63 VL15Dropped *uint64 // counters/VL15_dropped
44 ExcessiveBufferOverrunErrors *uint64 // counters/excessive_buffer_overrun_errors
45 LinkDowned *uint64 // counters/link_downed
46 LinkErrorRecovery *uint64 // counters/link_error_recovery
47 LocalLinkIntegrityErrors *uint64 // counters/local_link_integrity_errors
48 MulticastRcvPackets *uint64 // counters/multicast_rcv_packets
49 MulticastXmitPackets *uint64 // counters/multicast_xmit_packets
50 PortRcvConstraintErrors *uint64 // counters/port_rcv_constraint_errors
51 PortRcvData *uint64 // counters/port_rcv_data
52 PortRcvDiscards *uint64 // counters/port_rcv_discards
53 PortRcvErrors *uint64 // counters/port_rcv_errors
54 PortRcvPackets *uint64 // counters/port_rcv_packets
55 PortRcvRemotePhysicalErrors *uint64 // counters/port_rcv_remote_physical_errors
56 PortRcvSwitchRelayErrors *uint64 // counters/port_rcv_switch_relay_errors
57 PortXmitConstraintErrors *uint64 // counters/port_xmit_constraint_errors
58 PortXmitData *uint64 // counters/port_xmit_data
59 PortXmitDiscards *uint64 // counters/port_xmit_discards
60 PortXmitPackets *uint64 // counters/port_xmit_packets
61 PortXmitWait *uint64 // counters/port_xmit_wait
62 SymbolError *uint64 // counters/symbol_error
63 UnicastRcvPackets *uint64 // counters/unicast_rcv_packets
64 UnicastXmitPackets *uint64 // counters/unicast_xmit_packets
65 VL15Dropped *uint64 // counters/VL15_dropped
6466 }
6567
6668 // InfiniBandPort contains info from files in
269271 vp := util.NewValueParser(value)
270272
271273 switch f.Name() {
274 case "excessive_buffer_overrun_errors":
275 counters.ExcessiveBufferOverrunErrors = vp.PUInt64()
272276 case "link_downed":
273277 counters.LinkDowned = vp.PUInt64()
274278 case "link_error_recovery":
275279 counters.LinkErrorRecovery = vp.PUInt64()
280 case "local_link_integrity_errors":
281 counters.LocalLinkIntegrityErrors = vp.PUInt64()
276282 case "multicast_rcv_packets":
277283 counters.MulticastRcvPackets = vp.PUInt64()
278284 case "multicast_xmit_packets":
6262 }
6363
6464 var (
65 port1LinkDowned uint64
66 port1LinkErrorRecovery uint64
67 port1PortRcvConstraintErrors uint64
68 port1PortRcvData uint64 = 8884894436
69 port1PortRcvErrors uint64
70 port1PortRcvPackets uint64 = 87169372
71 port1PortRcvRemotePhysicalErrors uint64
72 port1PortRcvSwitchRelayErrors uint64
73 port1PortXmitConstraintErrors uint64
74 port1PortXmitData uint64 = 106036453180
75 port1PortXmitDiscards uint64
76 port1PortXmitPackets uint64 = 85734114
77 port1PortXmitWait uint64 = 3599
78 port1SymbolError uint64
79 port1VL15Dropped uint64
65 port1ExcessiveBufferOverrunErrors uint64
66 port1LinkDowned uint64
67 port1LinkErrorRecovery uint64
68 port1LocalLinkIntegrityErrors uint64
69 port1PortRcvConstraintErrors uint64
70 port1PortRcvData uint64 = 8884894436
71 port1PortRcvErrors uint64
72 port1PortRcvPackets uint64 = 87169372
73 port1PortRcvRemotePhysicalErrors uint64
74 port1PortRcvSwitchRelayErrors uint64
75 port1PortXmitConstraintErrors uint64
76 port1PortXmitData uint64 = 106036453180
77 port1PortXmitDiscards uint64
78 port1PortXmitPackets uint64 = 85734114
79 port1PortXmitWait uint64 = 3599
80 port1SymbolError uint64
81 port1VL15Dropped uint64
8082
81 port2LinkDowned uint64
82 port2LinkErrorRecovery uint64
83 port2PortRcvConstraintErrors uint64
84 port2PortRcvData uint64 = 9841747136
85 port2PortRcvErrors uint64
86 port2PortRcvPackets uint64 = 89332064
87 port2PortRcvRemotePhysicalErrors uint64
88 port2PortRcvSwitchRelayErrors uint64
89 port2PortXmitConstraintErrors uint64
90 port2PortXmitData uint64 = 106161427560
91 port2PortXmitDiscards uint64
92 port2PortXmitPackets uint64 = 88622850
93 port2PortXmitWait uint64 = 3846
94 port2SymbolError uint64
95 port2VL15Dropped uint64
83 port2ExcessiveBufferOverrunErrors uint64
84 port2LinkDowned uint64
85 port2LinkErrorRecovery uint64
86 port2LocalLinkIntegrityErrors uint64
87 port2PortRcvConstraintErrors uint64
88 port2PortRcvData uint64 = 9841747136
89 port2PortRcvErrors uint64
90 port2PortRcvPackets uint64 = 89332064
91 port2PortRcvRemotePhysicalErrors uint64
92 port2PortRcvSwitchRelayErrors uint64
93 port2PortXmitConstraintErrors uint64
94 port2PortXmitData uint64 = 106161427560
95 port2PortXmitDiscards uint64
96 port2PortXmitPackets uint64 = 88622850
97 port2PortXmitWait uint64 = 3846
98 port2SymbolError uint64
99 port2VL15Dropped uint64
96100 )
97101
98102 want := InfiniBandClass{
111115 PhysStateID: 5,
112116 Rate: 5000000000,
113117 Counters: InfiniBandCounters{
114 LinkDowned: &port1LinkDowned,
115 LinkErrorRecovery: &port1LinkErrorRecovery,
116 PortRcvConstraintErrors: &port1PortRcvConstraintErrors,
117 PortRcvData: &port1PortRcvData,
118 PortRcvErrors: &port1PortRcvErrors,
119 PortRcvPackets: &port1PortRcvPackets,
120 PortRcvRemotePhysicalErrors: &port1PortRcvRemotePhysicalErrors,
121 PortRcvSwitchRelayErrors: &port1PortRcvSwitchRelayErrors,
122 PortXmitConstraintErrors: &port1PortXmitConstraintErrors,
123 PortXmitData: &port1PortXmitData,
124 PortXmitDiscards: &port1PortXmitDiscards,
125 PortXmitPackets: &port1PortXmitPackets,
126 PortXmitWait: &port1PortXmitWait,
127 SymbolError: &port1SymbolError,
128 VL15Dropped: &port1VL15Dropped,
118 ExcessiveBufferOverrunErrors: &port1ExcessiveBufferOverrunErrors,
119 LinkDowned: &port1LinkDowned,
120 LinkErrorRecovery: &port1LinkErrorRecovery,
121 LocalLinkIntegrityErrors: &port1LocalLinkIntegrityErrors,
122 PortRcvConstraintErrors: &port1PortRcvConstraintErrors,
123 PortRcvData: &port1PortRcvData,
124 PortRcvErrors: &port1PortRcvErrors,
125 PortRcvPackets: &port1PortRcvPackets,
126 PortRcvRemotePhysicalErrors: &port1PortRcvRemotePhysicalErrors,
127 PortRcvSwitchRelayErrors: &port1PortRcvSwitchRelayErrors,
128 PortXmitConstraintErrors: &port1PortXmitConstraintErrors,
129 PortXmitData: &port1PortXmitData,
130 PortXmitDiscards: &port1PortXmitDiscards,
131 PortXmitPackets: &port1PortXmitPackets,
132 PortXmitWait: &port1PortXmitWait,
133 SymbolError: &port1SymbolError,
134 VL15Dropped: &port1VL15Dropped,
129135 },
130136 },
131137 2: {
137143 PhysStateID: 5,
138144 Rate: 5000000000,
139145 Counters: InfiniBandCounters{
140 LinkDowned: &port2LinkDowned,
141 LinkErrorRecovery: &port2LinkErrorRecovery,
142 PortRcvConstraintErrors: &port2PortRcvConstraintErrors,
143 PortRcvData: &port2PortRcvData,
144 PortRcvErrors: &port2PortRcvErrors,
145 PortRcvPackets: &port2PortRcvPackets,
146 PortRcvRemotePhysicalErrors: &port2PortRcvRemotePhysicalErrors,
147 PortRcvSwitchRelayErrors: &port2PortRcvSwitchRelayErrors,
148 PortXmitConstraintErrors: &port2PortXmitConstraintErrors,
149 PortXmitData: &port2PortXmitData,
150 PortXmitDiscards: &port2PortXmitDiscards,
151 PortXmitPackets: &port2PortXmitPackets,
152 PortXmitWait: &port2PortXmitWait,
153 SymbolError: &port2SymbolError,
154 VL15Dropped: &port2VL15Dropped,
146 ExcessiveBufferOverrunErrors: &port2ExcessiveBufferOverrunErrors,
147 LinkDowned: &port2LinkDowned,
148 LinkErrorRecovery: &port2LinkErrorRecovery,
149 LocalLinkIntegrityErrors: &port2LocalLinkIntegrityErrors,
150 PortRcvConstraintErrors: &port2PortRcvConstraintErrors,
151 PortRcvData: &port2PortRcvData,
152 PortRcvErrors: &port2PortRcvErrors,
153 PortRcvPackets: &port2PortRcvPackets,
154 PortRcvRemotePhysicalErrors: &port2PortRcvRemotePhysicalErrors,
155 PortRcvSwitchRelayErrors: &port2PortRcvSwitchRelayErrors,
156 PortXmitConstraintErrors: &port2PortXmitConstraintErrors,
157 PortXmitData: &port2PortXmitData,
158 PortXmitDiscards: &port2PortXmitDiscards,
159 PortXmitPackets: &port2PortXmitPackets,
160 PortXmitWait: &port2PortXmitWait,
161 SymbolError: &port2SymbolError,
162 VL15Dropped: &port2VL15Dropped,
155163 },
156164 },
157165 },