diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2022-06-28 17:04:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 17:04:37 +0300 |
commit | c3dfbe52a61dd0d1995bc420b0e0576cf058fd74 (patch) | |
tree | 193bfe3de88bff1a8effb9dd062a96beda8d16c6 | |
parent | e86cec2631c961b434031e2e09597701a9ec53f8 (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
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 |