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 /exporting/prometheus | |
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
Diffstat (limited to 'exporting/prometheus')
-rw-r--r-- | exporting/prometheus/prometheus.c | 18 | ||||
-rw-r--r-- | exporting/prometheus/remote_write/remote_write.c | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/exporting/prometheus/prometheus.c b/exporting/prometheus/prometheus.c index 95795742b8..1a9c72e8a0 100644 --- a/exporting/prometheus/prometheus.c +++ b/exporting/prometheus/prometheus.c @@ -362,7 +362,7 @@ static int print_host_variables(RRDVAR *rv, void *data) } } - calculated_number value = rrdvar2number(rv); + NETDATA_DOUBLE value = rrdvar2number(rv); if (isnan(value) || isinf(value)) { if (opts->output_options & PROMETHEUS_OUTPUT_HELP) buffer_sprintf( @@ -383,7 +383,7 @@ static int print_host_variables(RRDVAR *rv, void *data) if (opts->output_options & PROMETHEUS_OUTPUT_TIMESTAMPS) buffer_sprintf( opts->wb, - "%s_%s%s%s%s " CALCULATED_NUMBER_FORMAT " %llu\n", + "%s_%s%s%s%s " NETDATA_DOUBLE_FORMAT " %llu\n", opts->prefix, opts->name, label_pre, @@ -394,7 +394,7 @@ static int print_host_variables(RRDVAR *rv, void *data) else buffer_sprintf( opts->wb, - "%s_%s%s%s%s " CALCULATED_NUMBER_FORMAT "\n", + "%s_%s%s%s%s " NETDATA_DOUBLE_FORMAT "\n", opts->prefix, opts->name, label_pre, @@ -483,9 +483,9 @@ static void generate_as_collected_prom_metric(BUFFER *wb, struct gen_parameters if (prometheus_collector) buffer_sprintf( wb, - CALCULATED_NUMBER_FORMAT, - (calculated_number)p->rd->last_collected_value * (calculated_number)p->rd->multiplier / - (calculated_number)p->rd->divisor); + NETDATA_DOUBLE_FORMAT, + (NETDATA_DOUBLE)p->rd->last_collected_value * (NETDATA_DOUBLE)p->rd->multiplier / + (NETDATA_DOUBLE)p->rd->divisor); else buffer_sprintf(wb, COLLECTED_NUMBER_FORMAT, p->rd->last_collected_value); @@ -732,7 +732,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus( time_t first_time = instance->after; time_t last_time = instance->before; - calculated_number value = exporting_calculate_value_from_stored_data(instance, rd, &last_time); + NETDATA_DOUBLE value = exporting_calculate_value_from_stored_data(instance, rd, &last_time); if (!isnan(value) && !isinf(value)) { if (EXPORTING_OPTIONS_DATA_SOURCE(exporting_options) == EXPORTING_SOURCE_DATA_AVERAGE) @@ -764,7 +764,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus( if (output_options & PROMETHEUS_OUTPUT_TIMESTAMPS) buffer_sprintf( wb, - "%s_%s%s%s{chart=\"%s\",family=\"%s\",dimension=\"%s\"%s} " CALCULATED_NUMBER_FORMAT + "%s_%s%s%s{chart=\"%s\",family=\"%s\",dimension=\"%s\"%s} " NETDATA_DOUBLE_FORMAT " %llu\n", prefix, context, @@ -779,7 +779,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus( else buffer_sprintf( wb, - "%s_%s%s%s{chart=\"%s\",family=\"%s\",dimension=\"%s\"%s} " CALCULATED_NUMBER_FORMAT + "%s_%s%s%s{chart=\"%s\",family=\"%s\",dimension=\"%s\"%s} " NETDATA_DOUBLE_FORMAT "\n", prefix, context, diff --git a/exporting/prometheus/remote_write/remote_write.c b/exporting/prometheus/remote_write/remote_write.c index ac00d3b50e..f6abaab36c 100644 --- a/exporting/prometheus/remote_write/remote_write.c +++ b/exporting/prometheus/remote_write/remote_write.c @@ -294,7 +294,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * // we need average or sum of the data time_t last_t = instance->before; - calculated_number value = exporting_calculate_value_from_stored_data(instance, rd, &last_t); + NETDATA_DOUBLE value = exporting_calculate_value_from_stored_data(instance, rd, &last_t); if (!isnan(value) && !isinf(value)) { if (EXPORTING_OPTIONS_DATA_SOURCE(instance->config.options) == EXPORTING_SOURCE_DATA_AVERAGE) |