src/daemon/graphs/hostapd-station-rate-info.h \
src/daemon/graphs/hostapd-station-signal.c \
src/daemon/graphs/hostapd-station-signal.h \
+ src/daemon/graphs/legacy-gateway-latency4.c \
+ src/daemon/graphs/legacy-gateway-latency4.h \
src/daemon/graphs/legacy-suricata.c \
src/daemon/graphs/legacy-suricata.h \
src/daemon/graphs/loadavg.c \
#include "graphs/uptime.h"
// Legacy graphs
+#include "graphs/legacy-gateway-latency4.h"
#include "graphs/legacy-suricata.h"
// Register all graphs
&unbound_recursion_time_graph,
// Legacy
+ &legacy_gateway_latency4_graph,
&legacy_suricata_graph,
NULL,
DRAW_AREA_OUTLINE_WITH_LABEL(args, field, object, color, flags, label, ##__VA_ARGS__); \
} while(0)
+// Draws an invisible AREA
+#define DRAW_SPACER(args, field, object) \
+ SCRIPT(args, "AREA:" FIELD, FIELD_AND_OBJECT(field, object))
+
// Horizontal lines
#define DRAW_HRULE(args, value, color) \
SCRIPT(args, "HRULE:%lf" color, (double)value)
} while (0)
// Handles for fields
+#define FIELD_SPACER(field) field "_spacer"
#define FIELD_CURRENT(field) field "_cur"
#define FIELD_AVERAGE(field) field "_avg"
#define FIELD_MINIMUM(field) field "_min"
#define FIELD_MAXIMUM(field) field "_max"
#define FIELD_PERCENT(field) field "_p"
+#define FIELD_STDDEV2(field) field "_stddev2"
#define FIELD_INF(field) field "_inf"
#define FIELD_NEGINF(field) field "_neginf"
#define FIELD_BITS(field) field "_bits"
VALUE_ALL(args, FIELD_BYTES(field), object); \
} while (0)
+/*
+ Draw a standard deviation (this takes the baseline and the deviation)
+*/
+#define DRAW_STDDEV(args, baseline, stddev, object, color) \
+ do { \
+ COMPUTE_DIFFERENCE(args, FIELD_SPACER(baseline), object, baseline, object, stddev, object); \
+ COMPUTE_MULTIPLY(args, FIELD_STDDEV2(stddev), object, stddev, object, 2); \
+ DRAW_SPACER(args, FIELD_SPACER(baseline), object); \
+ DRAW_AREA_BACKGROUND(args, FIELD_STDDEV2(stddev), object, color, STACKED); \
+ } while (0)
+
/*
This draws an I/O graph
*/
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#include <limits.h>
+
+#include "graph.h"
+#include "legacy-gateway-latency4.h"
+
+static int legacy_gateway_latency4_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("Latency to the Default Gateway"));
+}
+
+static int legacy_gateway_latency4_render(td_ctx* ctx, td_graph* graph,
+ const td_graph_render_options* options, td_args* args, const char* object) {
+ int r;
+
+ // Load all sources
+ r = td_graph_require_source(graph, args, "legacy-gateway-latency4", NULL);
+ if (r < 0)
+ return r;
+
+ // Header
+ PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
+ // Draw the stddev area
+ DRAW_STDDEV(args, "latency", "stddev", NULL, COLOR_DEFAULT);
+
+ // Draw the measured latency
+ DRAW_LINE_WITH_LABEL(args, 1, "latency", NULL, COLOR_DEFAULT, 0, _("Latency"));
+ PRINT_CAMM(args, "latency", NULL, SECONDS_HIGHRES);
+
+ PRINT_EMPTY_LINE(args);
+
+ return 0;
+}
+
+const td_graph_impl legacy_gateway_latency4_graph = {
+ .name = "LegacyGatewayLatency4",
+ .render = legacy_gateway_latency4_render,
+ .title = legacy_gateway_latency4_title,
+ .vlabel = td_graph_vlabel_seconds,
+
+ // Limits
+ .lower_limit = 0,
+ .upper_limit = LONG_MAX,
+};
--- /dev/null
+/*#############################################################################
+# #
+# telemetryd - The IPFire Telemetry Collection Service #
+# Copyright (C) 2025 IPFire Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#ifndef TELEMETRY_GRAPH_LEGACY_GATEWAY_LATENCY4_H
+#define TELEMETRY_GRAPH_LEGACY_GATEWAY_LATENCY4_H
+
+#include "../graph.h"
+
+extern const td_graph_impl legacy_gateway_latency4_graph;
+
+#endif /* TELEMETRY_GRAPH_LEGACY_GATEWAY_LATENCY4_H */