From: Michael Tremer Date: Tue, 30 Sep 2025 15:21:25 +0000 (+0000) Subject: graphs: Add scaffolding for a loadavg graph X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3b4c766850710f5a75dc336ab0c58adfe8770e2;p=collecty.git graphs: Add scaffolding for a loadavg graph Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 8a93aed..199607b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -104,6 +104,8 @@ dist_collectyd_SOURCES = \ src/daemon/graph-bus.h \ src/daemon/graphs.c \ src/daemon/graphs.h \ + src/daemon/graphs/loadavg.c \ + src/daemon/graphs/loadavg.h \ src/daemon/logging.c \ src/daemon/logging.h \ src/daemon/main.c \ diff --git a/src/daemon/graphs.c b/src/daemon/graphs.c index 137849e..5f96e95 100644 --- a/src/daemon/graphs.c +++ b/src/daemon/graphs.c @@ -26,8 +26,12 @@ #include "graph.h" #include "graphs.h" +// Load all graphs +#include "graphs/loadavg.h" + // Register all graphs static const collecty_graph_impl* graph_impls[] = { + &loadavg_graph, NULL, }; diff --git a/src/daemon/graphs/loadavg.c b/src/daemon/graphs/loadavg.c new file mode 100644 index 0000000..0c72fca --- /dev/null +++ b/src/daemon/graphs/loadavg.c @@ -0,0 +1,26 @@ +/*############################################################################# +# # +# collecty - A system statistics collection daemon for IPFire # +# 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 . # +# # +#############################################################################*/ + +#include "../graph.h" +#include "loadavg.h" + +const collecty_graph_impl loadavg_graph = { + .name = "LoadAverage", +}; diff --git a/src/daemon/graphs/loadavg.h b/src/daemon/graphs/loadavg.h new file mode 100644 index 0000000..ad4d3a3 --- /dev/null +++ b/src/daemon/graphs/loadavg.h @@ -0,0 +1,28 @@ +/*############################################################################# +# # +# collecty - A system statistics collection daemon for IPFire # +# 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 . # +# # +#############################################################################*/ + +#ifndef COLLECTY_GRAPH_LOADAVG_H +#define COLLECTY_GRAPH_LOADAVG_H + +#include "../graph.h" + +extern const collecty_graph_impl loadavg_graph; + +#endif /* COLLECTY_GRAPH_LOADAVG_H */