]> git.ipfire.org Git - telemetry.git/commitdiff
graphs: Rename function to load a source
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 Jun 2026 14:47:21 +0000 (14:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 Jun 2026 14:47:21 +0000 (14:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
29 files changed:
src/daemon/graph.c
src/daemon/graph.h
src/daemon/graphs/conntrack.c
src/daemon/graphs/contextswitches.c
src/daemon/graphs/cpufreq.c
src/daemon/graphs/disk.c
src/daemon/graphs/hostapd-station-bandwidth.c
src/daemon/graphs/hostapd-station-rate-info.c
src/daemon/graphs/hostapd-station-signal.c
src/daemon/graphs/interface-packets.c
src/daemon/graphs/interface-throughput.c
src/daemon/graphs/knot-resolver-queries.c
src/daemon/graphs/legacy-gateway-latency4.c
src/daemon/graphs/legacy-hostile-drops.c
src/daemon/graphs/legacy-port-scans.c
src/daemon/graphs/legacy-suricata.c
src/daemon/graphs/loadavg.c
src/daemon/graphs/memory.c
src/daemon/graphs/pressure.c
src/daemon/graphs/processor-power-consumption.c
src/daemon/graphs/processor-temperature.c
src/daemon/graphs/processor.c
src/daemon/graphs/system-temperature.c
src/daemon/graphs/unbound-cache-performance.c
src/daemon/graphs/unbound-cache-usage.c
src/daemon/graphs/unbound-memory-usage.c
src/daemon/graphs/unbound-queries.c
src/daemon/graphs/unbound-recursion-time.c
src/daemon/graphs/uptime.c

index fb9470d8c63b9248b705f88090540beb50427589..9d7001b4fdf65605cf1d7f651d229b0185a9686f 100644 (file)
@@ -195,7 +195,7 @@ char* td_graph_get_bus_path(td_graph* self) {
        return path;
 }
 
-int td_graph_require_source(td_graph* self,
+int td_graph_load_source(td_graph* self,
                td_args* args, const char* name, const char* object) {
        td_sources* sources = NULL;
        td_source* source = NULL;
@@ -230,13 +230,13 @@ ERROR:
        return r;
 }
 
-int td_graph_require_sources(td_graph* self,
+int td_graph_load_sources(td_graph* self,
                td_args* args, const char* name, const char** objects) {
        int r;
 
        // Add objects
        for (const char** o = objects; *o; o++) {
-               r = td_graph_require_source(self, args, name, *o);
+               r = td_graph_load_source(self, args, name, *o);
                if (r < 0)
                        return r;
        }
index 5421f71ac075fc44ee12851e45a410c71eda9246..5890dc64983046ab952965ceee55b17fbaee41e0 100644 (file)
@@ -94,9 +94,9 @@ td_graph* td_graph_unref(td_graph* self);
 const char* td_graph_get_name(td_graph* self);
 char* td_graph_get_bus_path(td_graph* self);
 
-int td_graph_require_source(td_graph* self,
+int td_graph_load_source(td_graph* self,
        td_args* args, const char* name, const char* object);
-int td_graph_require_sources(td_graph* self,
+int td_graph_load_sources(td_graph* self,
        td_args* args, const char* name, const char** objects);
 
 int td_graph_render(td_graph* self, const char* object,
index 3ac2521da1a8e7deb9fac4612060955d90c38f13..f945c3c494c5832673cc9dc04f2a1d156caf1722 100644 (file)
@@ -39,7 +39,7 @@ static int conntrack_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This requires the conntrack source
-       r = td_graph_require_source(graph, args, "conntrack", NULL);
+       r = td_graph_load_source(graph, args, "conntrack", NULL);
        if (r < 0)
                return r;
 
index 7873a5ddcc6dab59f918261e055ad05c5d3374b2..ded1d71683acfee69defbe4c6522509e03a551a0 100644 (file)
@@ -39,7 +39,7 @@ static int contextswitches_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This requires the contextswitches source
-       r = td_graph_require_source(graph, args, "contextswitches", NULL);
+       r = td_graph_load_source(graph, args, "contextswitches", NULL);
        if (r < 0)
                return r;
 
index dd1a4a25bee290e2a52cfcbd1d7e2eadc5de2ac0..8d22bd446931f288fdd1a095463328c92347f645 100644 (file)
@@ -53,7 +53,7 @@ static int cpufreq_render(td_ctx* ctx, td_graph* graph,
                        return r;
 
                // Require the source
-               r = td_graph_require_source(graph, args, "cpufreq", object);
+               r = td_graph_load_source(graph, args, "cpufreq", object);
                if (r < 0)
                        return r;
 
index 601561aecdc2eebdf6200c1256baa865a5e82926..6deae2c0a7e2a4be0f3e381c79fd8ab3b1c6673c 100644 (file)
@@ -33,7 +33,7 @@ static int disk_io_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "disk", object);
+       r = td_graph_load_source(graph, args, "disk", object);
        if (r < 0)
                return r;
 
@@ -73,7 +73,7 @@ static int disk_temp_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "disk", object);
+       r = td_graph_load_source(graph, args, "disk", object);
        if (r < 0)
                return r;
 
index dab3362ecb0015f75b8f150e5d8498798c462eaf..388e91c415e61760281937f4eea113cd50116756 100644 (file)
@@ -34,7 +34,7 @@ static int hostapd_station_bandwidth_render(td_ctx* ctx,td_graph* graph,
        int r;
 
        // Require the source
-       r = td_graph_require_source(graph, args, "hostapd", object);
+       r = td_graph_load_source(graph, args, "hostapd", object);
        if (r < 0)
                return r;
 
index 918afadb2153a7418bcfd7897083326c95db5499..5bfaa93743ff6ceea0904c9808a2192c45f84e51 100644 (file)
@@ -34,7 +34,7 @@ static int hostapd_station_rate_info_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Require the source
-       r = td_graph_require_source(graph, args, "hostapd", object);
+       r = td_graph_load_source(graph, args, "hostapd", object);
        if (r < 0)
                return r;
 
index b5c255e8c40ff56cf723428cf7b5aca4c4344e08..d45561054c42f36ed6b821f034ab186c55055ef5 100644 (file)
@@ -46,7 +46,7 @@ static int hostapd_station_signal_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This require the source
-       r = td_graph_require_source(graph, args, "hostapd", object);
+       r = td_graph_load_source(graph, args, "hostapd", object);
        if (r < 0)
                return r;
 
index 114040194980ec63950b8cfd66954859fa8a17ba..4127f5e8d785cd19348fcf51eec167fc9ac12bb4 100644 (file)
@@ -33,7 +33,7 @@ static int interface_packets_render(td_ctx* ctx,td_graph* graph,
        int r;
 
        // Require the source
-       r = td_graph_require_source(graph, args, "interface", object);
+       r = td_graph_load_source(graph, args, "interface", object);
        if (r < 0)
                return r;
 
index dffbad9fb72407e8292bef3599ee58526115b218..f6b457d7a1fcf0a66493d4c6082a690a3a3e979e 100644 (file)
@@ -34,7 +34,7 @@ static int interface_throughput_render(td_ctx* ctx,td_graph* graph,
        int r;
 
        // Require the source
-       r = td_graph_require_source(graph, args, "interface", object);
+       r = td_graph_load_source(graph, args, "interface", object);
        if (r < 0)
                return r;
 
index cb0971dfee563af9bec2dea6037c9110db550671..544899d98ab668c6a355073258bcbef0dd0eeee6 100644 (file)
@@ -33,7 +33,7 @@ static int knot_resolver_queries_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "knot-resolver", NULL);
+       r = td_graph_load_source(graph, args, "knot-resolver", NULL);
        if (r < 0)
                return r;
 
index c058ce6511fc8fa47b457f1e3fcb4cf9ec670719..9a85b3c2124af8c603b611ba6ef3e86e86f68e0e 100644 (file)
@@ -33,7 +33,7 @@ static int legacy_gateway_latency4_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "legacy-gateway-latency4", NULL);
+       r = td_graph_load_source(graph, args, "legacy-gateway-latency4", NULL);
        if (r < 0)
                return r;
 
index 5a064b524b27e8d4d3edeac97080e1f49ea7fe6c..76eb183cc7e984277c69460d472a56d58e9ceb31 100644 (file)
@@ -33,7 +33,7 @@ static int legacy_hostile_drops_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "iptables", "DROP_HOSTILE");
+       r = td_graph_load_source(graph, args, "iptables", "DROP_HOSTILE");
        if (r < 0)
                return r;
 
index 9e04535f7ee850407006a6af0495061e919e3b46..83d784d8676466cd8628475323b799cdebb490c8 100644 (file)
@@ -42,7 +42,7 @@ static int legacy_port_scans_render(td_ctx* ctx, td_graph* graph,
        };
 
        // Load all sources
-       r = td_graph_require_sources(graph, args, "iptables", sources);
+       r = td_graph_load_sources(graph, args, "iptables", sources);
        if (r < 0)
                return r;
 
index 4fef694e655f668d33ee9cc3be8ae92c578b6805..a8a46098fe39d893719336f10231d720a78ccee3 100644 (file)
@@ -45,7 +45,7 @@ static int legacy_suricata_render(td_ctx* ctx, td_graph* graph,
        };
 
        // Load all sources
-       r = td_graph_require_sources(graph, args, "iptables", chains);
+       r = td_graph_load_sources(graph, args, "iptables", chains);
        if (r < 0)
                return r;
 
index 1d52679f27642c53eec98cf9ea45247afddc62ce..c6c47bc4e2db4893bc72fdcb3e9cff61b97532c3 100644 (file)
@@ -39,7 +39,7 @@ static int loadavg_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This requires the loadavg source
-       r = td_graph_require_source(graph, args, "loadavg", NULL);
+       r = td_graph_load_source(graph, args, "loadavg", NULL);
        if (r < 0)
                return r;
 
index dbe2112d644450f3fa98435126be61daf2f70e01..9a462805358f843d506a110ff3c89075d5d104ad 100644 (file)
@@ -39,7 +39,7 @@ static int memory_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This requires the loadavg source
-       r = td_graph_require_source(graph, args, "memory", NULL);
+       r = td_graph_load_source(graph, args, "memory", NULL);
        if (r < 0)
                return r;
 
index 91b1de7cd1f703b007f152ea2c27c5fcf42a19de..6122c1d88658dbecff44faf38066de754d28f38d 100644 (file)
@@ -29,7 +29,7 @@ static int pressure_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This requires the source
-       r = td_graph_require_source(graph, args, source, NULL);
+       r = td_graph_load_source(graph, args, source, NULL);
        if (r < 0)
                return r;
 
index 77c19519af17a44e82464c93512814bce4e71aa6..d2de62bc9fef89286241692876b6b31edc0e9fbd 100644 (file)
@@ -55,7 +55,7 @@ static int processor_power_consumption_render_sensor(td_ctx* ctx, td_source* sou
                return 0;
 
        // Add the source
-       r = td_graph_require_source(state->graph, state->args, "sensors-power", name);
+       r = td_graph_load_source(state->graph, state->args, "sensors-power", name);
        if (r < 0)
                return r;
 
index 9ddc244fda8dfc836954eb3e0c15d614c9c36083..726bb9788fcd33b449bc682f8c8e751ed842ce46 100644 (file)
@@ -58,7 +58,7 @@ static int processor_temperature_render_sensor(td_ctx* ctx, td_source* source,
                return 0;
 
        // Add the source
-       r = td_graph_require_source(state->graph, state->args, "sensors-temp", name);
+       r = td_graph_load_source(state->graph, state->args, "sensors-temp", name);
        if (r < 0)
                return r;
 
index 8eb0d918200a24fb0e24444301962adbff43a7b6..8748b53287ee204b0b8412209e3c97e6a3b3413e 100644 (file)
@@ -34,7 +34,7 @@ static int processor_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This requires the loadavg source
-       r = td_graph_require_source(graph, args, "processor", NULL);
+       r = td_graph_load_source(graph, args, "processor", NULL);
        if (r < 0)
                return r;
 
index 613e86dd11eb73756663b243a7e84bd454bf82cc..1128878e5d60e483bc548fd15096e9e495746cfc 100644 (file)
@@ -55,7 +55,7 @@ static int system_temperature_render_sensor(td_ctx* ctx, td_source* source,
                return 0;
 
        // Add the source
-       r = td_graph_require_source(state->graph, state->args, "sensors-temp", name);
+       r = td_graph_load_source(state->graph, state->args, "sensors-temp", name);
        if (r < 0)
                return r;
 
index 7a0fe76deb3bf21d5b6ed2e804c4aadf98c1d66f..a54b3ce0b0e74d47c5766390d9bb5daba3de0b63 100644 (file)
@@ -33,7 +33,7 @@ static int unbound_cache_performance_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "unbound", NULL);
+       r = td_graph_load_source(graph, args, "unbound", NULL);
        if (r < 0)
                return r;
 
index 1fcebbff2da1f2b74bf9ef9c9e2da767384d5297..976cb3597c1a1696124cc4d0b9be635a0a75ea7b 100644 (file)
@@ -33,7 +33,7 @@ static int unbound_cache_usage_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "unbound", NULL);
+       r = td_graph_load_source(graph, args, "unbound", NULL);
        if (r < 0)
                return r;
 
index b1ef29a3d0ed08cbe303ca4d57d8d4d9bde8bc23..f250fe5735ab42986637739a1e56642ed01aaea3 100644 (file)
@@ -33,7 +33,7 @@ static int unbound_memory_usage_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "unbound", NULL);
+       r = td_graph_load_source(graph, args, "unbound", NULL);
        if (r < 0)
                return r;
 
index 05a09ae08b0a20dcc8e4cc26b38b7bcca89dbfaf..c5b7fcd9fdd4e44c9af96b2166e9c919b613c839 100644 (file)
@@ -33,7 +33,7 @@ static int unbound_queries_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "unbound", NULL);
+       r = td_graph_load_source(graph, args, "unbound", NULL);
        if (r < 0)
                return r;
 
index cf9671ae5a261d05b93bfa7999a86709019b2e53..4d6b024dac4b974db7fc3f806fccf51e227548d1 100644 (file)
@@ -33,7 +33,7 @@ static int unbound_recursion_time_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // Load all sources
-       r = td_graph_require_source(graph, args, "unbound", NULL);
+       r = td_graph_load_source(graph, args, "unbound", NULL);
        if (r < 0)
                return r;
 
index 181dc83f376756ccd9bb7fc2da494a1c5427d678..7198dd6b0e4973a66cb4e99f09f3ee12c153c3a0 100644 (file)
@@ -34,7 +34,7 @@ static int uptime_render(td_ctx* ctx, td_graph* graph,
        int r;
 
        // This requires the uptime source
-       r = td_graph_require_source(graph, args, "uptime", NULL);
+       r = td_graph_load_source(graph, args, "uptime", NULL);
        if (r < 0)
                return r;