@@ -33,16 +33,18 @@ type wifiCollector struct {
33
33
interfaceFrequencyHertz * prometheus.Desc
34
34
stationInfo * prometheus.Desc
35
35
36
- stationConnectedSecondsTotal * prometheus.Desc
37
- stationInactiveSeconds * prometheus.Desc
38
- stationReceiveBitsPerSecond * prometheus.Desc
39
- stationTransmitBitsPerSecond * prometheus.Desc
40
- stationReceiveBytesTotal * prometheus.Desc
41
- stationTransmitBytesTotal * prometheus.Desc
42
- stationSignalDBM * prometheus.Desc
43
- stationTransmitRetriesTotal * prometheus.Desc
44
- stationTransmitFailedTotal * prometheus.Desc
45
- stationBeaconLossTotal * prometheus.Desc
36
+ stationConnectedSecondsTotal * prometheus.Desc
37
+ stationInactiveSeconds * prometheus.Desc
38
+ stationReceiveBitsPerSecond * prometheus.Desc
39
+ stationTransmitBitsPerSecond * prometheus.Desc
40
+ stationReceiveBytesTotal * prometheus.Desc
41
+ stationTransmitBytesTotal * prometheus.Desc
42
+ stationSignalDBM * prometheus.Desc
43
+ stationTransmitRetriesTotal * prometheus.Desc
44
+ stationTransmitFailedTotal * prometheus.Desc
45
+ stationBeaconLossTotal * prometheus.Desc
46
+ stationTransmittedPacketsTotal * prometheus.Desc
47
+ stationReceivedPacketsTotal * prometheus.Desc
46
48
47
49
logger * slog.Logger
48
50
}
@@ -159,6 +161,20 @@ func NewWifiCollector(logger *slog.Logger) (Collector, error) {
159
161
labels ,
160
162
nil ,
161
163
),
164
+
165
+ stationTransmittedPacketsTotal : prometheus .NewDesc (
166
+ prometheus .BuildFQName (namespace , subsystem , "station_transmitted_packets_total" ),
167
+ "The total number of packets transmitted by a station." ,
168
+ labels ,
169
+ nil ,
170
+ ),
171
+
172
+ stationReceivedPacketsTotal : prometheus .NewDesc (
173
+ prometheus .BuildFQName (namespace , subsystem , "station_received_packets_total" ),
174
+ "The total number of packets received by a station." ,
175
+ labels ,
176
+ nil ,
177
+ ),
162
178
logger : logger ,
163
179
}, nil
164
180
}
@@ -325,6 +341,22 @@ func (c *wifiCollector) updateStationStats(ch chan<- prometheus.Metric, device s
325
341
device ,
326
342
info .HardwareAddr .String (),
327
343
)
344
+
345
+ ch <- prometheus .MustNewConstMetric (
346
+ c .stationTransmittedPacketsTotal ,
347
+ prometheus .CounterValue ,
348
+ float64 (info .TransmittedPackets ),
349
+ device ,
350
+ info .HardwareAddr .String (),
351
+ )
352
+
353
+ ch <- prometheus .MustNewConstMetric (
354
+ c .stationReceivedPacketsTotal ,
355
+ prometheus .CounterValue ,
356
+ float64 (info .ReceivedPackets ),
357
+ device ,
358
+ info .HardwareAddr .String (),
359
+ )
328
360
}
329
361
330
362
func mHzToHz (mHz int ) float64 {
0 commit comments