From: Michael Tremer Date: Wed, 22 Oct 2025 19:31:22 +0000 (+0000) Subject: sources: hostapd: Convert rates after they have been parsed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=215d860c05f3d58c238a51d6254bb5a6d7fb77c0;p=telemetry.git sources: hostapd: Convert rates after they have been parsed Signed-off-by: Michael Tremer --- diff --git a/src/daemon/sources/hostapd.c b/src/daemon/sources/hostapd.c index 451b577..c03fbf1 100644 --- a/src/daemon/sources/hostapd.c +++ b/src/daemon/sources/hostapd.c @@ -97,6 +97,10 @@ static int hostapd_submit_station(td_ctx* ctx, hostapd_station* station) { return r; } + // Convert the RX/TX rate to bit/s (hostapd returns hundredth of kilobits) + station->rx_rate *= 100 * 1024; + station->tx_rate *= 100 * 1024; + // Submit the station return td_source_submit_values(station->source, address, VALUES( VALUE_UINT64("connected_time", &station->connected_time), @@ -182,10 +186,6 @@ static int hostapd_parse(td_ctx* ctx, td_file* stdout, unsigned long lineno, { NULL }, }; - // Convert the RX/TX rate to bit/s - station->rx_rate *= 100 * 1024; - station->tx_rate *= 100 * 1024; - // Try parsing the line return td_file_parse_line(stdout, parser, line, length); }