]> git.ipfire.org Git - collecty.git/commitdiff
graphs: Add scaffolding for a loadavg graph
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Sep 2025 15:21:25 +0000 (15:21 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Sep 2025 15:21:25 +0000 (15:21 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/daemon/graphs.c
src/daemon/graphs/loadavg.c [new file with mode: 0644]
src/daemon/graphs/loadavg.h [new file with mode: 0644]

index 8a93aedcbb5d623282d6398ce3f0ab3136bcc028..199607b65664666933c677c9846007083440d11c 100644 (file)
@@ -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 \
index 137849ef90885b3dc2232ff20104013f36d1d701..5f96e95baae87b8f366fd56bd34593580be1a938 100644 (file)
 #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 (file)
index 0000000..0c72fca
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+#############################################################################*/
+
+#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 (file)
index 0000000..ad4d3a3
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+#############################################################################*/
+
+#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 */