From: Michael Tremer Date: Wed, 29 Oct 2025 11:50:35 +0000 (+0000) Subject: graphs: Include the unit with the macro X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7753daab2a3d909158a00feb16bd68b237dca0bd;p=telemetry.git graphs: Include the unit with the macro Signed-off-by: Michael Tremer --- diff --git a/src/daemon/graphs/cpufreq.c b/src/daemon/graphs/cpufreq.c index 1b883c6..92891f7 100644 --- a/src/daemon/graphs/cpufreq.c +++ b/src/daemon/graphs/cpufreq.c @@ -59,7 +59,7 @@ static int cpufreq_render(td_ctx* ctx, // Draw the line DRAW_LINE_WITH_LABEL(args, 1, "freq_cur", object, COLOR_CPU(i), _("CPU Core %ld")); - PRINT_CAMM(args, "freq_cur", object, HZ, _("Hz")); + PRINT_CAMM(args, "freq_cur", object, HZ); // Draw the minimum DRAW_LINE(args, 2, "freq_min", object, MINIMUM); diff --git a/src/daemon/graphs/graph.h b/src/daemon/graphs/graph.h index 8cab94c..193d97a 100644 --- a/src/daemon/graphs/graph.h +++ b/src/daemon/graphs/graph.h @@ -57,8 +57,8 @@ #define FLOAT "%%14.2lf" #define FLOAT_WITH_UNIT "%%10.2lf %3s" #define LARGE_FLOAT "%%14.2lf %%s" -#define BPS "%%9.2lf %%s%3s" -#define HZ "%%10.2lf %%s%2s" +#define BPS "%%9.2lf %%s%3s", _("bps") +#define HZ "%%10.2lf %%s%2s", _("Hz") // Macro to terminate a line #define EOL "\\j" @@ -279,7 +279,7 @@ do { \ COMPUTE_BITS(args, FIELD_BITS(bytes), object, bytes); \ DRAW_AREA_WITH_LABEL(args, FIELD_BITS(bytes), object, color, label); \ - PRINT_CAMM(args, bytes, object, BPS, _("bps")); \ + PRINT_CAMM(args, bytes, object, BPS); \ } while (0) #endif /* TELEMETRY_GRAPHS_GRAPH_H */ diff --git a/src/daemon/graphs/hostapd-station-rate-info.c b/src/daemon/graphs/hostapd-station-rate-info.c index d83d6c1..9e02677 100644 --- a/src/daemon/graphs/hostapd-station-rate-info.c +++ b/src/daemon/graphs/hostapd-station-rate-info.c @@ -48,11 +48,11 @@ static int hostapd_station_rate_info_render(td_ctx* ctx, // Receive Rate DRAW_LINE_WITH_LABEL(args, 2, "rx_rate", object, COLOR_RX, _("Receive Rate")); - PRINT_CAMM(args, "rx_rate", object, BPS, _("bps")); + PRINT_CAMM(args, "rx_rate", object, BPS); // Transmit Rate DRAW_LINE_WITH_LABEL(args, 2, "tx_rate", object, COLOR_TX, _("Transmit Rate")); - PRINT_CAMM(args, "tx_rate", object, BPS, _("bps")); + PRINT_CAMM(args, "tx_rate", object, BPS); return 0; }