@cryptotaxi247 / netdata-1 / commits / 03231fc36

Use database/rrd.h instead of daemon/common.h (#19540)

vkalintiris committed Jan 31, 2025 at 11:52 UTC 03231fc362260e65b11013c3513b474e6968449c
56 files changed +66 -70
src/aclk/aclk.h
+1 -1
@@ -2,7 +2,7 @@
2 #ifndef ACLK_H
3 #define ACLK_H
4
5 -#include "daemon/common.h"
5 +#include "database/rrd.h"
6
7 #include "aclk_util.h"
8 //#include "aclk_rrdhost_state.h"
src/aclk/aclk_alarm_api.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef ACLK_ALARM_API_H
4 #define ACLK_ALARM_API_H
5
6 -#include "../daemon/common.h"
6 +#include "database/rrd.h"
7 #include "schema-wrappers/schema_wrappers.h"
8
9 void aclk_send_alarm_log_entry(struct alarm_log_entry *log_entry);
src/aclk/aclk_capas.h
+1 -2
@@ -3,8 +3,7 @@
3 #ifndef ACLK_CAPAS_H
4 #define ACLK_CAPAS_H
5
6 -#include "daemon/common.h"
7 -#include "libnetdata/libnetdata.h"
6 +#include "database/rrd.h"
7
8 #include "schema-wrappers/capability.h"
9
src/aclk/aclk_otp.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef ACLK_OTP_H
4 #define ACLK_OTP_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #include "https_client.h"
9 #include "aclk_util.h"
src/aclk/aclk_proxy.c
+1 -1
@@ -1,6 +1,6 @@
1 #include "aclk_proxy.h"
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4
5 #define ACLK_PROXY_ENV "env"
6 #define ACLK_PROXY_CONFIG_VAR "proxy"
src/aclk/aclk_query_queue.h
+1 -2
@@ -3,8 +3,7 @@
3 #ifndef NETDATA_ACLK_QUERY_QUEUE_H
4 #define NETDATA_ACLK_QUERY_QUEUE_H
5
6 -#include "libnetdata/libnetdata.h"
7 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7 #include "schema-wrappers/schema_wrappers.h"
8
9 #include "aclk_util.h"
src/aclk/aclk_util.c
+1 -1
@@ -4,7 +4,7 @@
4
5 #include "aclk_proxy.h"
6
7 -#include "daemon/common.h"
7 +#include "database/rrd.h"
8
9 usec_t aclk_session_newarch = 0;
10
src/collectors/all.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_ALL_H
4 #define NETDATA_ALL_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 // netdata internal data collection plugins
9
src/collectors/cgroups.plugin/sys_fs_cgroup.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_SYS_FS_CGROUP_H
4 #define NETDATA_SYS_FS_CGROUP_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #define PLUGIN_CGROUPS_NAME "cgroups.plugin"
9 #define PLUGIN_CGROUPS_MODULE_SYSTEMD_NAME "systemd"
src/collectors/ebpf.plugin/ebpf.c
+2 -1
@@ -4018,7 +4018,8 @@ int main(int argc, char **argv)
4018 ebpf_start_pthread_variables();
4019
4020 netdata_configured_host_prefix = getenv("NETDATA_HOST_PREFIX");
4021 - if(verify_netdata_host_prefix(true) == -1) ebpf_exit(6);
4021 + if(verify_netdata_host_prefix(true) == -1)
4022 + ebpf_exit();
4023
4024 ebpf_allocate_common_vectors();
4025
src/collectors/ebpf.plugin/ebpf.h
+1 -8
@@ -19,16 +19,9 @@
19 #include <ctype.h>
20 #include <dirent.h>
21
22 -// From libnetdata.h
23 -#include "libnetdata/threads/threads.h"
24 -#include "libnetdata/locks/locks.h"
25 -#include "libnetdata/avl/avl.h"
26 -#include "libnetdata/clocks/clocks.h"
27 -#include "libnetdata/config/appconfig.h"
22 #include "libbpf_api/ebpf.h"
29 -#include "libnetdata/procfile/procfile.h"
23 +
24 #include "collectors/cgroups.plugin/sys_fs_cgroup.h"
31 -#include "daemon/main.h"
25
26 #include "ebpf_apps.h"
27 #include "ebpf_functions.h"
src/collectors/freebsd.plugin/plugin_freebsd.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_PLUGIN_FREEBSD_H
4 #define NETDATA_PLUGIN_FREEBSD_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #include <sys/sysctl.h>
9
src/collectors/idlejitter.plugin/plugin_idlejitter.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4
5 #define CPU_IDLEJITTER_SLEEP_TIME_MS 20
6
src/collectors/macos.plugin/plugin_macos.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_PLUGIN_MACOS_H
4 #define NETDATA_PLUGIN_MACOS_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 int do_macos_sysctl(int update_every, usec_t dt);
9 int do_macos_mach_smi(int update_every, usec_t dt);
src/collectors/proc.plugin/plugin_proc.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_PLUGIN_PROC_H
4 #define NETDATA_PLUGIN_PROC_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #define PLUGIN_PROC_CONFIG_NAME "proc"
9 #define PLUGIN_PROC_NAME PLUGIN_PROC_CONFIG_NAME ".plugin"
src/collectors/proc.plugin/zfs_common.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_ZFS_COMMON_H
4 #define NETDATA_ZFS_COMMON_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #define ZFS_FAMILY_SIZE "size"
9 #define ZFS_FAMILY_EFFICIENCY "efficiency"
src/collectors/profile.plugin/plugin_profile.cc
+1 -1
@@ -4,7 +4,7 @@
4 extern "C" {
5 #endif
6
7 -#include "daemon/common.h"
7 +#include "database/rrd.h"
8
9 #ifdef __cplusplus
10 }
src/collectors/slabinfo.plugin/slabinfo.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "libnetdata/required_dummies.h"
5
6 #define PLUGIN_SLABINFO_NAME "slabinfo.plugin"
src/collectors/statsd.plugin/statsd.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4
5 #define STATSD_CHART_PREFIX "statsd"
6
src/collectors/tc.plugin/plugin_tc.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4
5 #define RRD_TYPE_TC "tc"
6 #define PLUGIN_TC_NAME "tc.plugin"
src/collectors/timex.plugin/plugin_timex.c
+1 -2
@@ -1,7 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
4 -#include "libnetdata/os/os.h"
3 +#include "database/rrd.h"
4
5 #define PLUGIN_TIMEX_NAME "timex.plugin"
6
src/collectors/windows.plugin/windows_plugin.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_WINDOWS_PLUGIN_H
4 #define NETDATA_WINDOWS_PLUGIN_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #define PLUGIN_WINDOWS_NAME "windows.plugin"
9
src/database/engine/dbengine-stresstest.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "../../daemon/common.h"
3 +#include "database/rrd.h"
4
5 #ifdef ENABLE_DBENGINE
6
src/database/engine/dbengine-unittest.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "../../daemon/common.h"
3 +#include "database/rrd.h"
4
5 #ifdef ENABLE_DBENGINE
6
src/database/engine/rrdengine.h
-1
@@ -8,7 +8,6 @@
8 #include <Judy.h>
9 #include <openssl/sha.h>
10 #include <openssl/evp.h>
11 -#include "daemon/common.h"
11 #include "../rrd.h"
12 #include "rrddiskprotocol.h"
13 #include "rrdenginelib.h"
src/database/rrdhost-system-info.c
+1 -2
@@ -2,7 +2,6 @@
2
3 #define RRDHOST_SYSTEM_INFO_INTERNALS
4 #include "rrdhost-system-info.h"
5 -#include "daemon/common.h"
5 #include "aclk/schema-wrappers/node_info.h"
6 #include "daemon/win_system-info.h"
7
@@ -558,4 +557,4 @@ void rrdhost_system_info_to_streaming_function_array(BUFFER *wb, struct rrdhost_
557 buffer_json_add_array_item_string(wb, "");
558 buffer_json_add_array_item_string(wb, "");
559 }
561 -}
\ No newline at end of file
560 +}
src/database/sqlite/sqlite_context.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_SQLITE_CONTEXT_H
4 #define NETDATA_SQLITE_CONTEXT_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7 #include "database/sqlite/vendored/sqlite3.h"
8
9 int sql_context_cache_stats(int op);
src/database/sqlite/sqlite_db_migration.h
+9 -1
@@ -2,7 +2,11 @@
2 #ifndef NETDATA_SQLITE_DB_MIGRATION_H
3 #define NETDATA_SQLITE_DB_MIGRATION_H
4
5 -#include "daemon/common.h"
5 +#ifdef __cplusplus
6 +extern "C" {
7 +#endif
8 +
9 +#include "database/rrd.h"
10 #include "database/sqlite/vendored/sqlite3.h"
11
12 int perform_database_migration(sqlite3 *database, int target_version);
@@ -10,4 +14,8 @@ int perform_context_database_migration(sqlite3 *database, int target_version);
14 int table_exists_in_database(sqlite3 *database, const char *table);
15 int perform_ml_database_migration(sqlite3 *database, int target_version);
16
17 +#ifdef __cplusplus
18 +}
19 +#endif
20 +
21 #endif //NETDATA_SQLITE_DB_MIGRATION_H
src/database/sqlite/sqlite_functions.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_SQLITE_FUNCTIONS_H
4 #define NETDATA_SQLITE_FUNCTIONS_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7 #include "database/sqlite/vendored/sqlite3.h"
8
9 void analytics_set_data_str(char **name, const char *value);
src/database/sqlite/sqlite_health.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_SQLITE_HEALTH_H
4 #define NETDATA_SQLITE_HEALTH_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7 #include "database/sqlite/vendored/sqlite3.h"
8
9 #define ALERT_TRANSITION_DELAY_LONG (600)
src/database/sqlite/sqlite_metadata.c
+1 -1
@@ -4,7 +4,7 @@
4 #include "database/sqlite/vendored/sqlite3recover.h"
5 #include "health/health-alert-entry.h"
6
7 -//#include "sqlite_db_migration.h"
7 +#include "sqlite_db_migration.h"
8
9 #define DB_METADATA_VERSION 18
10
src/exporting/exporting_engine.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_EXPORTING_ENGINE_H
4 #define NETDATA_EXPORTING_ENGINE_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7 #include <uv.h>
8
9 #define exporter_get(section, name, value) expconfig_get(&exporting_config, section, name, value)
src/health/health.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_HEALTH_H
4 #define NETDATA_HEALTH_H 1
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7 #include "rrdcalc.h"
8
9 typedef enum __attribute__((packed)) {
src/ml/ml_public.cc
+2
@@ -2,6 +2,8 @@
2
3 #include "ml_private.h"
4
5 +#include "database/sqlite/sqlite_db_migration.h"
6 +
7 #include <random>
8
9 #define ML_METADATA_VERSION 2
src/ml/ml_public.h
+2 -2
@@ -7,9 +7,9 @@
7 extern "C" {
8 #endif
9
10 -#include "daemon/common.h"
10 +#include "database/rrd.h"
11 #include "web/api/queries/rrdr.h"
12 -#include "database/sqlite/sqlite_db_migration.h"
12 +#include "database/sqlite/vendored/sqlite3.h"
13
14 bool ml_capable();
15 bool ml_enabled(RRDHOST *rh);
src/plugins.d/pluginsd_parser.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_PLUGINSD_PARSER_H
4 #define NETDATA_PLUGINSD_PARSER_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #ifdef NETDATA_LOG_STREAM_RECEIVER
9 #include "streaming/stream-receiver-internals.h"
src/registry/registry.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "registry_internals.h"
5
6 #define REGISTRY_STATUS_OK "ok"
src/registry/registry.h
+1 -1
@@ -49,7 +49,7 @@
49 #ifndef NETDATA_REGISTRY_H
50 #define NETDATA_REGISTRY_H 1
51
52 -#include "daemon/common.h"
52 +#include "database/rrd.h"
53
54 #define NETDATA_REGISTRY_COOKIE_NAME "netdata_registry_id"
55
src/registry/registry_db.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "registry_internals.h"
5
6 int registry_db_should_be_saved(void) {
src/registry/registry_init.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "registry_internals.h"
5
6 void registry_db_stats(void) {
src/registry/registry_internals.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "registry_internals.h"
5
6 struct registry registry;
src/registry/registry_log.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "registry_internals.h"
5
6 void registry_log(char action, REGISTRY_PERSON *p, REGISTRY_MACHINE *m, STRING *u, const char *name) {
src/registry/registry_machine.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "registry_internals.h"
5
6 // ----------------------------------------------------------------------------
src/registry/registry_person.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "registry_internals.h"
5
6 // ----------------------------------------------------------------------------
src/streaming/stream-conf.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "stream-receiver-internals.h"
5 #include "stream-sender-internals.h"
6
src/streaming/stream-replication-sender.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef REPLICATION_H
4 #define REPLICATION_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7 #include "stream-circular-buffer.h"
8
9 #ifdef __cplusplus
src/web/api/functions/function-bearer_get_token.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_FUNCTION_BEARER_GET_TOKEN_H
4 #define NETDATA_FUNCTION_BEARER_GET_TOKEN_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 int function_bearer_get_token(BUFFER *wb, const char *function, BUFFER *payload, const char *source);
9 int call_function_bearer_get_token(RRDHOST *host, struct web_client *w, const char *claim_id, const char *machine_guid, const char *node_id);
src/web/api/functions/function-progress.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_FUNCTION_PROGRESS_H
4 #define NETDATA_FUNCTION_PROGRESS_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 int function_progress(BUFFER *wb, const char *function, BUFFER *payload, const char *source);
9
src/web/api/functions/function-streaming.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_FUNCTION_STREAMING_H
4 #define NETDATA_FUNCTION_STREAMING_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #define RRDFUNCTIONS_STREAMING_HELP "Streaming status for parents and children."
9
src/web/api/functions/functions.h
+1 -1
@@ -3,7 +3,7 @@
3 #ifndef NETDATA_FUNCTIONS_H
4 #define NETDATA_FUNCTIONS_H
5
6 -#include "daemon/common.h"
6 +#include "database/rrd.h"
7
8 #include "function-metrics-cardinality.h"
9 #include "function-streaming.h"
src/web/api/queries/weights.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "KolmogorovSmirnovDist.h"
5
6 #define MAX_POINTS 10000
src/web/api/web_api.h
+1 -1
@@ -8,7 +8,7 @@
8
9 struct web_client;
10
11 -#include "daemon/common.h"
11 +#include "database/rrd.h"
12 #include "maps/maps.h"
13 #include "functions/functions.h"
14
src/web/server/h2o/http_server.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "streaming/h2o-common.h"
5 #include "http_server.h"
6
src/web/server/h2o/rrdpush.c
+1 -1
@@ -1,6 +1,6 @@
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 -#include "daemon/common.h"
3 +#include "database/rrd.h"
4 #include "streaming.h"
5 #include "connlist.h"
6 #include "h2o_utils.h"
src/web/server/web_client.h
+1 -1
@@ -242,7 +242,7 @@ void web_client_free(struct web_client *w);
242
243 #include "web/api/web_api_v1.h"
244 #include "web/api/web_api_v2.h"
245 -#include "daemon/common.h"
245 +#include "database/rrd.h"
246
247 void web_client_decode_path_and_query_string(struct web_client *w, const char *path_and_query_string);
248 int web_client_api_request(RRDHOST *host, struct web_client *w, char *url_path_fragment);
src/web/server/web_server.h
+1 -4
@@ -3,8 +3,7 @@
3 #ifndef NETDATA_WEB_SERVER_H
4 #define NETDATA_WEB_SERVER_H 1
5
6 -#include "libnetdata/libnetdata.h"
7 -#include "web_client.h"
6 +#include "database/rrd.h"
7
8 #ifndef API_LISTEN_PORT
9 #define API_LISTEN_PORT 19999
@@ -58,6 +57,4 @@ struct web_client *web_client_create_on_listenfd(int listener);
57
58 #include "static/static-threaded.h"
59
61 -#include "daemon/common.h"
62 -
60 #endif /* NETDATA_WEB_SERVER_H */