summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-06-28 17:04:37 +0300
committerGitHub <noreply@github.com>2022-06-28 17:04:37 +0300
commitc3dfbe52a61dd0d1995bc420b0e0576cf058fd74 (patch)
tree193bfe3de88bff1a8effb9dd062a96beda8d16c6
parente86cec2631c961b434031e2e09597701a9ec53f8 (diff)
netdata doubles (#13217)
* netdata doubles * fix cmocka test * fix cmocka test again * fix left-overs of long double to NETDATA_DOUBLE * RRDDIM detached from disk representation; db settings in [db] section of netdata.conf * update the memory before saving * rrdset is now detached from file structures too * on memory mode map, update the memory mapped structures on every iteration * allow RRD_ID_LENGTH_MAX to be changed * granularity secs, back to update every * fix formatting * more formatting
-rw-r--r--aclk/aclk_rx_msgs.c8
-rw-r--r--cli/README.md2
-rw-r--r--collectors/apps.plugin/apps_plugin.c18
-rw-r--r--collectors/cgroups.plugin/sys_fs_cgroup.c24
-rw-r--r--collectors/cgroups.plugin/tests/test_doubles.c2
-rw-r--r--collectors/ebpf.plugin/ebpf_cachestat.c8
-rw-r--r--collectors/ebpf.plugin/ebpf_dcstat.c4
-rw-r--r--collectors/perf.plugin/perf_plugin.c4
-rw-r--r--collectors/plugins.d/pluginsd_parser.c6
-rw-r--r--collectors/plugins.d/pluginsd_parser.h3
-rw-r--r--collectors/proc.plugin/proc_diskstats.c2
-rw-r--r--collectors/proc.plugin/proc_mdstat.c4
-rw-r--r--collectors/proc.plugin/proc_net_dev.c2
-rw-r--r--collectors/proc.plugin/proc_net_wireless.c12
-rw-r--r--collectors/proc.plugin/sys_devices_system_edac_mc.c2
-rw-r--r--collectors/statsd.plugin/statsd.c40
-rw-r--r--daemon/config/README.md78
-rw-r--r--daemon/global_statistics.c2
-rw-r--r--daemon/main.c135
-rw-r--r--daemon/unit_test.c251
-rw-r--r--database/README.md41
-rw-r--r--database/engine/README.md65
-rw-r--r--database/engine/rrdengine.c14
-rwxr-xr-xdatabase/engine/rrdengineapi.c5
-rw-r--r--database/engine/rrdengineapi.h4
-rw-r--r--database/metric_correlations.c66
-rw-r--r--database/ram/rrddim_mem.c11
-rw-r--r--database/ram/rrddim_mem.h5
-rw-r--r--database/rrd.h94
-rw-r--r--database/rrdcalc.c10
-rw-r--r--database/rrdcalc.h8
-rw-r--r--database/rrdcalctemplate.h4
-rw-r--r--database/rrddim.c353
-rw-r--r--database/rrdhost.c16
-rw-r--r--database/rrdset.c616
-rw-r--r--database/rrdsetvar.c9
-rw-r--r--database/rrdsetvar.h2
-rw-r--r--database/rrdvar.c20
-rw-r--r--database/rrdvar.h4
-rw-r--r--database/sqlite/sqlite_aclk_alert.c8
-rw-r--r--database/sqlite/sqlite_health.c4
-rw-r--r--docs/guides/longer-metrics-storage.md54
-rw-r--r--exporting/exporting_engine.h3
-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.c10
-rw-r--r--exporting/prometheus/prometheus.c18
-rw-r--r--exporting/prometheus/remote_write/remote_write.c2
-rw-r--r--exporting/tests/exporting_doubles.c6
-rw-r--r--exporting/tests/netdata_doubles.c6
-rw-r--r--exporting/tests/test_exporting_engine.h6
-rw-r--r--health/health.c17
-rw-r--r--health/health.h6
-rw-r--r--health/health_config.c16
-rw-r--r--health/health_log.c6
-rw-r--r--libnetdata/buffer/buffer.c8
-rw-r--r--libnetdata/buffer/buffer.h2
-rw-r--r--libnetdata/clocks/clocks.c2
-rw-r--r--libnetdata/config/appconfig.c47
-rw-r--r--libnetdata/config/appconfig.h6
-rw-r--r--libnetdata/eval/eval.c112
-rw-r--r--libnetdata/eval/eval.h6
-rw-r--r--libnetdata/inlined.h71
-rw-r--r--libnetdata/json/json.c4
-rw-r--r--libnetdata/json/json.h10
-rw-r--r--libnetdata/required_dummies.h2
-rw-r--r--libnetdata/statistical/statistical.c180
-rw-r--r--libnetdata/statistical/statistical.h40
-rw-r--r--libnetdata/storage_number/storage_number.c34
-rw-r--r--libnetdata/storage_number/storage_number.h179
-rw-r--r--libnetdata/storage_number/tests/test_storage_number.c20
-rw-r--r--libnetdata/tests/test_str2ld.c4
-rw-r--r--ml/Dimension.cc2
-rw-r--r--ml/ml.cc4
-rw-r--r--parser/parser.h2
-rw-r--r--streaming/rrdpush.c13
-rw-r--r--streaming/sender.c6
-rw-r--r--tests/profile/test-eval.c10
-rw-r--r--web/api/badges/web_buffer_svg.c39
-rw-r--r--web/api/badges/web_buffer_svg.h6
-rw-r--r--web/api/exporters/shell/allmetrics_shell.c20
-rw-r--r--web/api/formatters/csv/csv.c10
-rw-r--r--web/api/formatters/json/json.c14
-rw-r--r--web/api/formatters/json_wrapper.c12
-rw-r--r--web/api/formatters/rrd2json.c4
-rw-r--r--web/api/formatters/rrd2json.h6
-rw-r--r--web/api/formatters/rrdset2json.c4
-rw-r--r--web/api/formatters/ssv/ssv.c2
-rw-r--r--web/api/formatters/value/value.c13
-rw-r--r--web/api/formatters/value/value.h3
-rw-r--r--web/api/queries/average/average.c8
-rw-r--r--web/api/queries/average/average.h4
-rw-r--r--web/api/queries/countif/countif.c26
-rw-r--r--web/api/queries/countif/countif.h4
-rw-r--r--web/api/queries/des/des.c24
-rw-r--r--web/api/queries/des/des.h4
-rw-r--r--web/api/queries/incremental_sum/incremental_sum.c10
-rw-r--r--web/api/queries/incremental_sum/incremental_sum.h4
-rw-r--r--web/api/queries/max/max.c10
-rw-r--r--web/api/queries/max/max.h4
-rw-r--r--web/api/queries/median/median.c18
-rw-r--r--web/api/queries/median/median.h4
-rw-r--r--web/api/queries/min/min.c10
-rw-r--r--web/api/queries/min/min.h4
-rw-r--r--web/api/queries/query.c33
-rw-r--r--web/api/queries/rrdr.c6
-rw-r--r--web/api/queries/rrdr.h12
-rw-r--r--web/api/queries/ses/ses.c16
-rw-r--r--web/api/queries/ses/ses.h4
-rw-r--r--web/api/queries/stddev/stddev.c34
-rw-r--r--web/api/queries/stddev/stddev.h10
-rw-r--r--web/api/queries/sum/sum.c8
-rw-r--r--web/api/queries/sum/sum.h4
114 files changed, 1787 insertions, 1503 deletions
diff --git a/aclk/aclk_rx_msgs.c b/aclk/aclk_rx_msgs.c
index 65e4955b82..a47918706b 100644
--- a/aclk/aclk_rx_msgs.c
+++ b/aclk/aclk_rx_msgs.c
@@ -55,19 +55,19 @@ static int cloud_to_agent_parse(JSON_ENTRY *e)
break;
case JSON_NUMBER:
if (!strcmp(e->name, "version")) {
- data->version = e->data.number;
+ data->version = (int)e->data.number;
break;
}
if (!strcmp(e->name, "timeout")) {
- data->timeout = e->data.number;
+ data->timeout = (int)e->data.number;
break;
}
if (!strcmp(e->name, "min-version")) {
- data->min_version = e->data.number;
+ data->min_version = (int)e->data.number;
break;
}
if (!strcmp(e->name, "max-version")) {
- data->max_version = e->data.number;
+ data->max_version = (int)e->data.number;
break;
}
diff --git a/cli/README.md b/cli/README.md
index 75a90b08a2..afd5651cb6 100644
--- a/cli/README.md
+++ b/cli/README.md
@@ -20,7 +20,7 @@ reload-health
reload-labels
Reload all labels.
save-database
- Save internal DB to disk for memory mode save.
+ Save internal DB to disk for database mode save.
reopen-logs
Close and reopen log files.
shutdown-agent
diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c
index 8a115d0612..8521e078e8 100644
--- a/collectors/apps.plugin/apps_plugin.c
+++ b/collectors/apps.plugin/apps_plugin.c
@@ -173,7 +173,8 @@ static kernel_uint_t
global_gtime = 0;
// the normalization ratios, as calculated by normalize_utilization()
-double utime_fix_ratio = 1.0,
+NETDATA_DOUBLE
+ utime_fix_ratio = 1.0,
stime_fix_ratio = 1.0,
gtime_fix_ratio = 1.0,
minflt_fix_ratio = 1.0,
@@ -501,7 +502,8 @@ struct file_descriptor {
static int
all_files_len = 0,
all_files_size = 0;
- long double currentmaxfds = 0;
+
+long currentmaxfds = 0;
// ----------------------------------------------------------------------------
// read users and groups from files
@@ -3021,7 +3023,7 @@ static inline void aggregate_pid_fds_on_targets(struct pid_stat *p) {
reallocate_target_fds(u);
reallocate_target_fds(g);
- long double currentfds = 0;
+ long currentfds = 0;
size_t c, size = p->fds_size;
struct pid_fd *fds = p->fds;
for(c = 0; c < size ;c++) {
@@ -3373,7 +3375,7 @@ static void normalize_utilization(struct target *root) {
gtime_fix_ratio =
cutime_fix_ratio =
cstime_fix_ratio =
- cgtime_fix_ratio = 1.0; //(double)(global_utime + global_stime) / (double)(utime + cutime + stime + cstime);
+ cgtime_fix_ratio = 1.0; //(NETDATA_DOUBLE)(global_utime + global_stime) / (NETDATA_DOUBLE)(utime + cutime + stime + cstime);
}
else if((global_utime + global_stime > utime + stime) && (cutime || cstime)) {
// children resources are too high
@@ -3383,7 +3385,7 @@ static void normalize_utilization(struct target *root) {
gtime_fix_ratio = 1.0;
cutime_fix_ratio =
cstime_fix_ratio =
- cgtime_fix_ratio = (double)((global_utime + global_stime) - (utime + stime)) / (double)(cutime + cstime);
+ cgtime_fix_ratio = (NETDATA_DOUBLE)((global_utime + global_stime) - (utime + stime)) / (NETDATA_DOUBLE)(cutime + cstime);
}
else if(utime || stime) {
// even running processes are unrealistic
@@ -3391,7 +3393,7 @@ static void normalize_utilization(struct target *root) {
// lower the running processes resources
utime_fix_ratio =
stime_fix_ratio =
- gtime_fix_ratio = (double)(global_utime + global_stime) / (double)(utime + stime);
+ gtime_fix_ratio = (NETDATA_DOUBLE)(global_utime + global_stime) / (NETDATA_DOUBLE)(utime + stime);
cutime_fix_ratio =
cstime_fix_ratio =
cgtime_fix_ratio = 0.0;
@@ -3439,14 +3441,14 @@ static void normalize_utilization(struct target *root) {
if(utime || stime || gtime)
majflt_fix_ratio =
- minflt_fix_ratio = (double)(utime * utime_fix_ratio + stime * stime_fix_ratio + gtime * gtime_fix_ratio) / (dou