summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2023-07-26 15:30:49 +0300
committerGitHub <noreply@github.com>2023-07-26 15:30:49 +0300
commit440bd51e08fdfa2a4daa191fb68643456028a753 (patch)
tree1d2cc2b0afc24b6b77f95f2cf3a1bdbaa544e278
parent3829b4c48ade535aa2d0a1153d45b49184b27a4b (diff)
Refactor RRD code. (#15423)
* Storage engine. * Host indexes to rrdb * Move globals to rrdb * Move storage_tiers_backfill to rrdb * default_rrd_update_every to rrdb * default_rrd_history_entries to rrdb * gap_when_lost_iterations_above to rrdb * rrdset_free_obsolete_time_s to rrdb * libuv_worker_threads to rrdb * ieee754_doubles to rrdb * rrdhost_free_orphan_time_s to rrdb * rrd_rwlock to rrdb * localhost to rrdb * rm extern from func decls * mv rrd macro under rrd.h * default_rrdeng_page_cache_mb to rrdb * default_rrdeng_extent_cache_mb to rrdb * db_engine_journal_check to rrdb * default_rrdeng_disk_quota_mb to rrdb * default_multidb_disk_quota_mb to rrdb * multidb_ctx to rrdb * page_type_size to rrdb * tier_page_size to rrdb * No storage_engine_id in rrdim functions * storage_engine_id is provided by st * Update to fix merge conflict. * Update field name * Remove unnecessary macros from rrd.h * Rm unused type decls * Rm duplicate func decls * make internal function static * Make the rest of public dbengine funcs accept a storage_instance. * No more rrdengine_instance :) * rm rrdset_debug from rrd.h * Use rrdb to access globals in ML and ACLK Missed due to not having the submodules in the worktree. * rm total_number * rm RRDVAR_TYPE_TOTAL * rm unused inline * Rm names from typedef'd enums * rm unused header include * Move include * Rm unused header include * s/rrdhost_find_or_create/rrdhost_get_or_create/g * s/find_host_by_node_id/rrdhost_find_by_node_id/ Also, remove duplicate definition in rrdcontext.c * rm macro used only once * rm macro used only once * Reduce rrd.h api by moving funcs into a collector specific utils header * Remove unused func * Move parser specific function out of rrd.h * return storage_number instead of void pointer * move code related to rrd initialization out of rrdhost.c * Remove tier_grouping from rrdim_tier Saves 8 * storage_tiers bytes per dimension. * Fix rebase * s/rrd_update_every/update_every/ * Mark functions as static and constify args * Add license notes and file to build systems. * Remove remaining non-log/config mentions of memory mode * Move rrdlabels api to separate file. Also, move localhost functions that loads labels outside of database/ and into daemon/ * Remove function decl in rrd.h * merge rrdhost_cache_dir_for_rrdset_alloc into rrdset_cache_dir * Do not expose internal function from rrd.h * Rm NETDATA_RRD_INTERNALS Only one function decl is covered. We have more database internal functions that we currently expose for no good reason. These will be placed in a separate internal header in follow up PRs. * Add license note * Include libnetdata.h instead of aral.h * Use rrdb to access localhost * Fix builds without dbengine * Add header to build system files * Add rrdlabels.h to build systems * Move func def from rrd.h to rrdhost.c * Fix macos build * Rm non-existing function * Rebase master * Define buffer length macro in ad_charts. * Fix FreeBSD builds. * Mark functions static * Rm func decls without definitions * Rebase master * Rebase master * Properly initialize value of storage tiers. * Fix build after rebase.
-rw-r--r--CMakeLists.txt4
-rw-r--r--Makefile.am4
-rw-r--r--aclk/aclk.c36
-rw-r--r--aclk/aclk_capas.c6
-rw-r--r--aclk/aclk_proxy.c2
-rw-r--r--aclk/aclk_proxy.h2
-rw-r--r--aclk/aclk_query.c2
-rw-r--r--aclk/aclk_rrdhost_state.h2
-rw-r--r--aclk/aclk_rx_msgs.c8
-rw-r--r--aclk/aclk_stats.c50
-rw-r--r--aclk/aclk_tx_msgs.c30
-rw-r--r--aclk/aclk_util.c14
-rw-r--r--aclk/schema-wrappers/node_info.cc2
-rw-r--r--aclk/schema-wrappers/proto_2_json.cc2
-rw-r--r--claim/claim.c13
-rw-r--r--collectors/cgroups.plugin/sys_fs_cgroup.c6
-rw-r--r--collectors/cgroups.plugin/tests/test_doubles.c8
-rw-r--r--collectors/diskspace.plugin/plugin_diskspace.c9
-rw-r--r--collectors/ebpf.plugin/ebpf_unittest.h4
-rw-r--r--collectors/freebsd.plugin/plugin_freebsd.c4
-rw-r--r--collectors/freebsd.plugin/plugin_freebsd.h1
-rw-r--r--collectors/idlejitter.plugin/plugin_idlejitter.c4
-rw-r--r--collectors/macos.plugin/plugin_macos.c4
-rw-r--r--collectors/macos.plugin/plugin_macos.h1
-rw-r--r--collectors/plugins.d/local_listeners.c2
-rw-r--r--collectors/plugins.d/plugins_d.c4
-rw-r--r--collectors/plugins.d/pluginsd_parser.c41
-rw-r--r--collectors/proc.plugin/ipc.c12
-rw-r--r--collectors/proc.plugin/plugin_proc.c4
-rw-r--r--collectors/proc.plugin/proc_mdstat.c1
-rw-r--r--collectors/proc.plugin/proc_net_dev.c4
-rw-r--r--collectors/proc.plugin/proc_net_netstat.c4
-rw-r--r--collectors/proc.plugin/proc_net_sockstat.c16
-rw-r--r--collectors/proc.plugin/proc_net_softnet_stat.c1
-rw-r--r--collectors/proc.plugin/proc_net_stat_conntrack.c4
-rw-r--r--collectors/proc.plugin/proc_net_wireless.c2
-rw-r--r--collectors/proc.plugin/proc_stat.c4
-rw-r--r--collectors/proc.plugin/sys_devices_pci_aer.c2
-rw-r--r--collectors/profile.plugin/plugin_profile.cc4
-rw-r--r--collectors/statsd.plugin/statsd.c25
-rw-r--r--collectors/tc.plugin/plugin_tc.c14
-rw-r--r--collectors/timex.plugin/plugin_timex.c4
-rw-r--r--collectors/utils.h42
-rw-r--r--daemon/analytics.c44
-rw-r--r--daemon/analytics.h2
-rw-r--r--daemon/buildinfo.c4
-rw-r--r--daemon/commands.c6
-rw-r--r--daemon/global_statistics.c182
-rw-r--r--daemon/main.c330
-rw-r--r--daemon/main.h2
-rw-r--r--daemon/service.c22
-rw-r--r--daemon/unit_test.c62
-rw-r--r--database/contexts/api_v2.c29
-rw-r--r--database/contexts/internal.h1
-rw-r--r--database/contexts/query_scope.c2
-rw-r--r--database/contexts/query_target.c38
-rw-r--r--database/contexts/rrdcontext.c25
-rw-r--r--database/contexts/rrdcontext.h2
-rw-r--r--database/contexts/worker.c12
-rw-r--r--database/engine/cache.c2
-rw-r--r--database/engine/cache.h2
-rw-r--r--database/engine/datafile.c4
-rw-r--r--database/engine/journalfile.c12
-rw-r--r--database/engine/metric.c2
-rw-r--r--database/engine/metric.h2
-rw-r--r--database/engine/pagecache.c9
-rw-r--r--database/engine/pdc.c4
-rw-r--r--database/engine/rrddim_eng.h73
-rw-r--r--database/engine/rrdengine.c25
-rw-r--r--database/engine/rrdengine.h2
-rw-r--r--[-rwxr-xr-x]database/engine/rrdengineapi.c155
-rw-r--r--database/engine/rrdengineapi.h63
-rw-r--r--database/engine/rrdenginelib.c4
-rw-r--r--database/ram/rrddim_mem.c25
-rw-r--r--database/ram/rrddim_mem.h37
-rw-r--r--database/rrd.c441
-rw-r--r--database/rrd.h681
-rw-r--r--database/rrdcalc.c2
-rw-r--r--database/rrddim.c443
-rw-r--r--database/rrdfamily.c1
-rw-r--r--database/rrdfunctions.c7
-rw-r--r--database/rrdfunctions.h2
-rw-r--r--database/rrdhost.c702
-rw-r--r--database/rrdlabels.c32
-rw-r--r--database/rrdlabels.h60
-rw-r--r--database/rrdset.c659
-rw-r--r--database/rrdvar.c5
-rw-r--r--database/rrdvar.h3
-rw-r--r--database/sqlite/sqlite_aclk.c16
-rw-r--r--database/sqlite/sqlite_aclk.h2
-rw-r--r--database/sqlite/sqlite_aclk_alert.c16
-rw-r--r--database/sqlite/sqlite_aclk_node.c12
-rw-r--r--database/sqlite/sqlite_functions.c16
-rw-r--r--database/sqlite/sqlite_functions.h2
-rw-r--r--database/sqlite/sqlite_health.c14
-rw-r--r--database/sqlite/sqlite_metadata.c34
-rw-r--r--database/storage_engine.c143
-rw-r--r--database/storage_engine.h451
-rw-r--r--database/storage_engine_types.h56
-rw-r--r--exporting/check_filters.c6
-rw-r--r--exporting/exporting_engine.c2
-rw-r--r--exporting/graphite/graphite.c4
-rw-r--r--exporting/json/json.c4
-rw-r--r--exporting/opentsdb/opentsdb.c8
-rw-r--r--exporting/process_data.c8
-rw-r--r--exporting/prometheus/prometheus.c6
-rw-r--r--exporting/prometheus/remote_write/remote_write.c12
-rw-r--r--exporting/read_config.c4
-rw-r--r--exporting/send_internal_metrics.c2
-rw-r--r--exporting/tests/exporting_fixtures.c4
-rw-r--r--exporting/tests/netdata_doubles.c12
-rw-r--r--exporting/tests/test_exporting_engine.c4
-rw-r--r--health/health.c16
-rw-r--r--health/health.h7
-rw-r--r--health/health_config.c2
-rw-r--r--libnetdata/aral/aral.c3
-rw-r--r--libnetdata/aral/aral.h1
-rw-r--r--libnetdata/circular_buffer/circular_buffer.c2
-rw-r--r--libnetdata/circular_buffer/circular_buffer.h2
-rw-r--r--libnetdata/json/jsmn.c2
-rw-r--r--libnetdata/json/jsmn.h2
-rw-r--r--libnetdata/libnetdata.c4
-rw-r--r--libnetdata/libnetdata.h3
-rw-r--r--libnetdata/onewayalloc/onewayalloc.c2
-rw-r--r--libnetdata/onewayalloc/onewayalloc.h2
-rw-r--r--