diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2018-10-24 23:06:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 23:06:46 +0300 |
commit | c9234ccc8cea6023c190370ea7e7e95fb5433dab (patch) | |
tree | 955e51a3c95b461490623d30ccc0750a6357f084 /backends | |
parent | 67f46998a42f0c534bd9860dece9547bb0ed8895 (diff) |
query code cleanup (#4480)
* queries code cleanup; renaming of variables; user configurable; tuning for defaults
* reformatted main queries array
* added documentation about all queries
* empty doc
* changed resampling variable names
* added documentation to query module functions
* fixed typos
* renames
* identation
* more renames
* fixed a faulty function definition at backends
Diffstat (limited to 'backends')
-rw-r--r-- | backends/backends.c | 3 | ||||
-rw-r--r-- | backends/backends.h | 8 | ||||
-rw-r--r-- | backends/prometheus/backend_prometheus.c | 1 |
3 files changed, 8 insertions, 4 deletions
diff --git a/backends/backends.c b/backends/backends.c index 6cb1e1c62a..0e201ddb23 100644 --- a/backends/backends.c +++ b/backends/backends.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later +#define BACKENDS_INTERNALS #include "backends.h" // ---------------------------------------------------------------------------- @@ -48,7 +49,7 @@ size_t backend_name_copy(char *d, const char *s, size_t usable) { // calculate the SUM or AVERAGE of a dimension, for any timeframe // may return NAN if the database does not have any value in the give timeframe -inline calculated_number backend_calculate_value_from_stored_data( +calculated_number backend_calculate_value_from_stored_data( RRDSET *st // the chart , RRDDIM *rd // the dimension , time_t after // the start timestamp diff --git a/backends/backends.h b/backends/backends.h index 9be4afd87c..468e4fed85 100644 --- a/backends/backends.h +++ b/backends/backends.h @@ -24,22 +24,24 @@ extern const char *global_backend_prefix; extern void *backends_main(void *ptr); -extern int backends_can_send_rrdset(BACKEND_OPTIONS backend_options, RRDSET *st); extern BACKEND_OPTIONS backend_parse_data_source(const char *source, BACKEND_OPTIONS backend_options); +#ifdef BACKENDS_INTERNALS + +extern int backends_can_send_rrdset(BACKEND_OPTIONS backend_options, RRDSET *st); extern calculated_number backend_calculate_value_from_stored_data( RRDSET *st // the chart , RRDDIM *rd // the dimension , time_t after // the start timestamp , time_t before // the end timestamp - , uint32_t backend_options // BACKEND_SOURCE_* bitmap + , BACKEND_OPTIONS backend_options // BACKEND_SOURCE_* bitmap , time_t *first_timestamp // the timestamp of the first point used in this response , time_t *last_timestamp // the timestamp that should be reported to backend ); -#ifdef BACKENDS_INTERNALS extern size_t backend_name_copy(char *d, const char *s, size_t usable); extern int discard_response(BUFFER *b, const char *backend); + #endif // BACKENDS_INTERNALS #include "backends/prometheus/backend_prometheus.h" diff --git a/backends/prometheus/backend_prometheus.c b/backends/prometheus/backend_prometheus.c index 3ef453d193..223b3f9f03 100644 --- a/backends/prometheus/backend_prometheus.c +++ b/backends/prometheus/backend_prometheus.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later +#define BACKENDS_INTERNALS #include "backend_prometheus.h" // ---------------------------------------------------------------------------- |