]> git.ipfire.org Git - people/ms/telemetry.git/commitdiff
legacy-gateway-latency4: Reverse the graph
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Nov 2025 20:35:34 +0000 (20:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Nov 2025 20:35:34 +0000 (20:35 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/graphs/legacy-gateway-latency4.c

index f7d66c37b1ae307c094b74d8e85b75dd92cb87de..82ba30f734660173db64796c081922a33090ef63 100644 (file)
@@ -37,12 +37,12 @@ static int legacy_gateway_latency4_render(td_ctx* ctx, td_graph* graph,
        if (r < 0)
                return r;
 
-       // Header
-       PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
+       PRINT_EMPTY_LINE(args);
 
        // Draw a horizontal line of the average
-       DRAW_LINE(args, 1, FIELD_AVERAGE("latency"), NULL,
-               COLOR_WITH_ALPHA(COLOR_LATENCY, COLOR_OPACITY_25P), DASHED);
+       DRAW_LINE_WITH_LABEL(args, 1, FIELD_AVERAGE("latency"), NULL,
+               COLOR_WITH_ALPHA(COLOR_LATENCY, COLOR_OPACITY_25P), DASHED, _("Average Latency"));
+       PRINT_EOL(args);
 
        // Draw the stddev area
        DRAW_STDDEV(args, "latency", "stddev", NULL, COLOR_LATENCY);
@@ -51,7 +51,8 @@ static int legacy_gateway_latency4_render(td_ctx* ctx, td_graph* graph,
        DRAW_LINE_WITH_LABEL(args, 1, "latency", NULL, COLOR_LATENCY, 0, _("Latency"));
        PRINT_CAMM(args, "latency", NULL, SECONDS_HIGHRES);
 
-       PRINT_EMPTY_LINE(args);
+       // Header
+       PRINT_HEADER4(args, _("Current"), _("Average"), _("Minimum"), _("Maximum"));
 
        return 0;
 }
@@ -62,6 +63,9 @@ const td_graph_impl legacy_gateway_latency4_graph = {
        .title   = legacy_gateway_latency4_title,
        .vlabel  = td_graph_vlabel_seconds,
 
+       // Flags
+       .flags   = TELEMETRY_GRAPH_REVERSE,
+
        // Limits
        .lower_limit = 0,
        .upper_limit = LONG_MAX,