--- /dev/null
+/*#############################################################################
+# #
+# 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 "../ctx.h"
+#include "../proc.h"
+#include "../source.h"
+#include "pressure-io.h"
+
+static int pressure_io_collect(collecty_ctx* ctx, collecty_source* source) {
+ collecty_pressure_stats stats = {};
+ int r;
+
+ // Read all values from /proc/pressure/io
+ r = collecty_proc_read_pressure(ctx, "io", &stats);
+ if (r < 0)
+ return r;
+
+ // Submit the values
+ return collecty_source_submit(source, NULL, "%.2f:%.2f:%.2f:%lu:%.2f:%.2f:%.2f:%lu",
+ stats.some.avg10, stats.some.avg60, stats.some.avg300, stats.some.total,
+ stats.full.avg10, stats.full.avg60, stats.full.avg300, stats.full.total);
+}
+
+const collecty_source_impl pressure_io_source = {
+ .name = "pressure-io",
+
+ // RRD Data Sources
+ .rrd_dss = {
+ // some
+ { "some_avg10", "GAUGE", 0, 100, },
+ { "some_avg60", "GAUGE", 0, 100, },
+ { "some_avg300", "GAUGE", 0, 100, },
+ { "some_total", "DERIVE", 0, -1, },
+
+ // full
+ { "full_avg10", "GAUGE", 0, 100, },
+ { "full_avg60", "GAUGE", 0, 100, },
+ { "full_avg300", "GAUGE", 0, 100, },
+ { "full_total", "DERIVE", 0, -1, },
+ { NULL },
+ },
+
+ // Methods
+ .collect = pressure_io_collect,
+};
--- /dev/null
+/*#############################################################################
+# #
+# 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_SOURCE_PRESSURE_IO_H
+#define COLLECTY_SOURCE_PRESSURE_IO_H
+
+#include "../source.h"
+
+extern const collecty_source_impl pressure_io_source;
+
+#endif /* COLLECTY_SOURCE_PRESSURE_IO_H */