.lower_limit = 0,
.upper_limit = LONG_MAX,
};
+
+// Transports
+
+static int knot_resolver_transports_title(td_ctx* ctx, td_graph* graph,
+ const char* object, char* title, size_t length) {
+ return __td_string_set(title, length, _("Transports"));
+}
+
+static int knot_resolver_transports_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_load_source(graph, args, "knot-resolver", NULL);
+ if (r < 0)
+ return r;
+
+ // Draw the stacked backgrounds first
+ DRAW_AREA_BACKGROUND(args, "request_doq", NULL, COLOR_DOQ, 0);
+ DRAW_AREA_BACKGROUND(args, "request_doh", NULL, COLOR_DOH, STACKED);
+ DRAW_AREA_BACKGROUND(args, "request_dot", NULL, COLOR_DOT, STACKED);
+ DRAW_AREA_BACKGROUND(args, "request_tcp", NULL, COLOR_TCP, STACKED);
+ DRAW_AREA_BACKGROUND(args, "request_udp", NULL, COLOR_UDP, STACKED);
+
+ // Draw the area outlines afterwards
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "request_doq", NULL, COLOR_DOQ, 0, _("QUIC"));
+ PRINT_CAMM(args, "request_doq", NULL, QPS, QPS_UNIT);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "request_doh", NULL, COLOR_DOH, STACKED, _("HTTPS"));
+ PRINT_CAMM(args, "request_doh", NULL, QPS, QPS_UNIT);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "request_dot", NULL, COLOR_DOT, STACKED, _("TLS"));
+ PRINT_CAMM(args, "request_dot", NULL, QPS, QPS_UNIT);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "request_tcp", NULL, COLOR_TCP, STACKED, _("TCP"));
+ PRINT_CAMM(args, "request_tcp", NULL, QPS, QPS_UNIT);
+
+ DRAW_AREA_OUTLINE_WITH_LABEL(args, "request_udp", NULL, COLOR_UDP, STACKED, _("UDP"));
+ PRINT_CAMM(args, "request_udp", NULL, QPS, QPS_UNIT);
+
+ PRINT_EMPTY_LINE(args);
+
+ // Show the total queries
+ PRINT_LABEL(args, _("Total"));
+ PRINT_CAMM(args, "request_total", NULL, QPS, QPS_UNIT);
+
+ // Header
+ PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+
+ return 0;
+}
+
+const td_graph_impl knot_resolver_transports_graph = {
+ .name = "KnotResolverTransports",
+ .can_render = knot_resolver_can_render,
+ .render = knot_resolver_transports_render,
+ .title = knot_resolver_transports_title,
+ .vlabel = td_graph_vlabel_qps,
+
+ // Flags
+ .flags = TELEMETRY_GRAPH_REVERSE,
+
+ // Limits
+ .lower_limit = 0,
+ .upper_limit = LONG_MAX,
+};