src/daemon/sources/test-error.h \
src/daemon/sources/test-flapping.c \
src/daemon/sources/test-flapping.h \
+ src/daemon/sources/test-stall.c \
+ src/daemon/sources/test-stall.h \
src/daemon/util.c \
src/daemon/util.h
#include "sources/processor.h"
#include "sources/test-error.h"
#include "sources/test-flapping.h"
+#include "sources/test-stall.h"
// Register all sources
static const collecty_source_impl* source_impls[] = {
// Tests
&test_error_source,
&test_flapping_source,
+ &test_stall_source,
NULL,
};
--- /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 "../source.h"
+#include "test-stall.h"
+
+/*
+ This is a test stalls the event loop.
+*/
+
+static int test_stall_collect(collecty_ctx* ctx, collecty_source* source) {
+ // Sleep for 500ms
+ return usleep(500000);
+}
+
+const collecty_source_impl test_stall_source = {
+ .name = "test-stall",
+
+ // Methods
+ .collect = test_stall_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_TEST_STALL_H
+#define COLLECTY_SOURCE_TEST_STALL_H
+
+#include "../source.h"
+
+extern const collecty_source_impl test_stall_source;
+
+#endif /* COLLECTY_SOURCE_TEST_STALL_H */