--- /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 "unbound.h"
+
+static int unbound_queries_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("DNS Queries"));
+}
+
+static int unbound_queries_vlabel(td_ctx* ctx, td_graph* graph,
+ const char* object, char* vlabel, size_t length) {
+ return __td_string_set(vlabel, length, _("Queries Per Second"));
+}
+
+static int unbound_queries_render(td_ctx* ctx,
+ td_graph* graph, td_args* args, const char* object) {
+ int r;
+
+ // Load all sources
+ r = td_graph_require_source(graph, args, "unbound", NULL);
+ if (r < 0)
+ return r;
+
+ // Header
+ PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
+ // Show the total queries
+ PRINT_LABEL(args, _("Total"));
+ PRINT_CAMM(args, "queries", NULL, QPS);
+
+ PRINT_EMPTY_LINE(args);
+
+ // Draw the stacked background first
+ DRAW_AREA_BACKGROUND(args, "cachehits", NULL, COLOR_CACHE_HIT, 0);
+ DRAW_AREA_BACKGROUND(args, "cachemiss", NULL, COLOR_CACHE_MISS, STACKED);
+
+ // Draw the area outlines afterwards
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "cachehits", NULL,
+ COLOR_CACHE_HIT, 0, _("Cache Hits"));
+ PRINT_CAMM(args, "cachehits", NULL, QPS);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "cachemiss", NULL,
+ COLOR_CACHE_MISS, STACKED, _("Cache Miss"));
+ PRINT_CAMM(args, "cachemiss", NULL, QPS);
+
+ return 0;
+}
+
+const td_graph_impl unbound_queries_graph = {
+ .name = "UnboundQueries",
+ .render = unbound_queries_render,
+ .title = unbound_queries_title,
+ .vlabel = unbound_queries_vlabel,
+
+ // 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_UNBOUND_H
+#define TELEMETRY_GRAPH_UNBOUND_H
+
+#include "../graph.h"
+
+extern const td_graph_impl unbound_queries_graph;
+
+#endif /* TELEMETRY_GRAPH_UNBOUND_H */