diff options
Diffstat (limited to 'src/web/api/queries')
-rw-r--r-- | src/web/api/queries/average/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/countif/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/des/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/incremental_sum/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/max/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/median/README.md | 10 | ||||
-rw-r--r-- | src/web/api/queries/min/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/percentile/README.md | 10 | ||||
-rw-r--r-- | src/web/api/queries/rrdr.h | 56 | ||||
-rw-r--r-- | src/web/api/queries/ses/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/stddev/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/sum/README.md | 9 | ||||
-rw-r--r-- | src/web/api/queries/trimmed_mean/README.md | 10 | ||||
-rw-r--r-- | src/web/api/queries/weights.c | 16 | ||||
-rw-r--r-- | src/web/api/queries/weights.h | 2 |
15 files changed, 10 insertions, 175 deletions
diff --git a/src/web/api/queries/average/README.md b/src/web/api/queries/average/README.md index 1ad78bee..97fb8beb 100644 --- a/src/web/api/queries/average/README.md +++ b/src/web/api/queries/average/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Average or Mean" -sidebar_label: "Average or Mean" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/average/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Average or Mean > This query is available as `average` and `mean`. diff --git a/src/web/api/queries/countif/README.md b/src/web/api/queries/countif/README.md index a4053539..1b7b682c 100644 --- a/src/web/api/queries/countif/README.md +++ b/src/web/api/queries/countif/README.md @@ -1,12 +1,3 @@ -<!-- -title: "CountIf" -sidebar_label: "CountIf" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/countif/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # CountIf > This query is available as `countif`. diff --git a/src/web/api/queries/des/README.md b/src/web/api/queries/des/README.md index 6dc19e73..fb053de5 100644 --- a/src/web/api/queries/des/README.md +++ b/src/web/api/queries/des/README.md @@ -1,12 +1,3 @@ -<!-- -title: "double exponential smoothing" -sidebar_label: "double exponential smoothing" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/des/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # double exponential smoothing Exponential smoothing is one of many window functions commonly applied to smooth data in signal diff --git a/src/web/api/queries/incremental_sum/README.md b/src/web/api/queries/incremental_sum/README.md index 6f02abe7..5e246289 100644 --- a/src/web/api/queries/incremental_sum/README.md +++ b/src/web/api/queries/incremental_sum/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Incremental Sum (`incremental_sum`)" -sidebar_label: "Incremental Sum (`incremental_sum`)" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/incremental_sum/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Incremental Sum (`incremental_sum`) This modules finds the incremental sum of a period, which `last value - first value`. diff --git a/src/web/api/queries/max/README.md b/src/web/api/queries/max/README.md index ae634e05..6a24a0a5 100644 --- a/src/web/api/queries/max/README.md +++ b/src/web/api/queries/max/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Max" -sidebar_label: "Max" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/max/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Max This module finds the max value in the time-frame given. diff --git a/src/web/api/queries/median/README.md b/src/web/api/queries/median/README.md index e6f6c04e..42a9afb1 100644 --- a/src/web/api/queries/median/README.md +++ b/src/web/api/queries/median/README.md @@ -1,13 +1,3 @@ -<!-- -title: "Median" -sidebar_label: "Median" -description: "Use median in API queries and health entities to find the 'middle' value from a sample, eliminating any unwanted spikes in the returned metrics." -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/median/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Median The median is the value separating the higher half from the lower half of a data sample diff --git a/src/web/api/queries/min/README.md b/src/web/api/queries/min/README.md index 35acb8c9..f2a35d62 100644 --- a/src/web/api/queries/min/README.md +++ b/src/web/api/queries/min/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Min" -sidebar_label: "Min" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/min/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Min This module finds the min value in the time-frame given. diff --git a/src/web/api/queries/percentile/README.md b/src/web/api/queries/percentile/README.md index 88abf8d5..0f9a2f39 100644 --- a/src/web/api/queries/percentile/README.md +++ b/src/web/api/queries/percentile/README.md @@ -1,13 +1,3 @@ -<!-- -title: "Percentile" -sidebar_label: "Percentile" -description: "Use percentile in API queries and health entities to find the 'percentile' value from a sample, eliminating any unwanted spikes in the returned metrics." -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/percentile/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Percentile The percentile is the average value of a series using only the smaller N percentile of the values. diff --git a/src/web/api/queries/rrdr.h b/src/web/api/queries/rrdr.h index d36d3f5b..860a375c 100644 --- a/src/web/api/queries/rrdr.h +++ b/src/web/api/queries/rrdr.h @@ -17,62 +17,6 @@ typedef enum tier_query_fetch { TIER_QUERY_FETCH_AVERAGE } TIER_QUERY_FETCH; -typedef enum rrdr_options { - RRDR_OPTION_NONZERO = (1 << 0), // don't output dimensions with just zero values - RRDR_OPTION_REVERSED = (1 << 1), // output the rows in reverse order (oldest to newest) - RRDR_OPTION_ABSOLUTE = (1 << 2), // values positive, for DATASOURCE_SSV before summing - RRDR_OPTION_DIMS_MIN2MAX = (1 << 3), // when adding dimensions, use max - min, instead of sum - RRDR_OPTION_DIMS_AVERAGE = (1 << 4), // when adding dimensions, use average, instead of sum - RRDR_OPTION_DIMS_MIN = (1 << 5), // when adding dimensions, use minimum, instead of sum - RRDR_OPTION_DIMS_MAX = (1 << 6), // when adding dimensions, use maximum, instead of sum - RRDR_OPTION_SECONDS = (1 << 7), // output seconds, instead of dates - RRDR_OPTION_MILLISECONDS = (1 << 8), // output milliseconds, instead of dates - RRDR_OPTION_NULL2ZERO = (1 << 9), // do not show nulls, convert them to zeros - RRDR_OPTION_OBJECTSROWS = (1 << 10), // each row of values should be an object, not an array - RRDR_OPTION_GOOGLE_JSON = (1 << 11), // comply with google JSON/JSONP specs - RRDR_OPTION_JSON_WRAP = (1 << 12), // wrap the response in a JSON header with info about the result - RRDR_OPTION_LABEL_QUOTES = (1 << 13), // in CSV output, wrap header labels in double quotes - RRDR_OPTION_PERCENTAGE = (1 << 14), // give values as percentage of total - RRDR_OPTION_NOT_ALIGNED = (1 << 15), // do not align charts for persistent timeframes - RRDR_OPTION_DISPLAY_ABS = (1 << 16), // for badges, display the absolute value, but calculate colors with sign - RRDR_OPTION_MATCH_IDS = (1 << 17), // when filtering dimensions, match only IDs - RRDR_OPTION_MATCH_NAMES = (1 << 18), // when filtering dimensions, match only names - RRDR_OPTION_NATURAL_POINTS = (1 << 19), // return the natural points of the database - RRDR_OPTION_VIRTUAL_POINTS = (1 << 20), // return virtual points - RRDR_OPTION_ANOMALY_BIT = (1 << 21), // Return the anomaly bit stored in each collected_number - RRDR_OPTION_RETURN_RAW = (1 << 22), // Return raw data for aggregating across multiple nodes - RRDR_OPTION_RETURN_JWAR = (1 << 23), // Return anomaly rates in jsonwrap - RRDR_OPTION_SELECTED_TIER = (1 << 24), // Use the selected tier for the query - RRDR_OPTION_ALL_DIMENSIONS = (1 << 25), // Return the full dimensions list - RRDR_OPTION_SHOW_DETAILS = (1 << 26), // v2 returns detailed object tree - RRDR_OPTION_DEBUG = (1 << 27), // v2 returns request description - RRDR_OPTION_MINIFY = (1 << 28), // remove JSON spaces and newlines from JSON output - RRDR_OPTION_GROUP_BY_LABELS = (1 << 29), // v2 returns flattened labels per dimension of the chart - - // internal ones - not to be exposed to the API - RRDR_OPTION_INTERNAL_AR = (1 << 31), // internal use only, to let the formatters know we want to render the anomaly rate -} RRDR_OPTIONS; - -typedef enum context_v2_options { - CONTEXT_V2_OPTION_MINIFY = (1 << 0), // remove JSON spaces and newlines from JSON output - CONTEXT_V2_OPTION_DEBUG = (1 << 1), // show the request - CONTEXT_V2_OPTION_ALERTS_WITH_CONFIGURATIONS = (1 << 2), // include alert configurations (used by /api/v2/alert_transitions) - CONTEXT_V2_OPTION_ALERTS_WITH_INSTANCES = (1 << 3), // include alert instances (used by /api/v2/alerts) - CONTEXT_V2_OPTION_ALERTS_WITH_VALUES = (1 << 4), // include alert latest values (used by /api/v2/alerts) - CONTEXT_V2_OPTION_ALERTS_WITH_SUMMARY = (1 << 5), // include alerts summary counters (used by /api/v2/alerts) -} CONTEXTS_V2_OPTIONS; - -typedef enum context_v2_alert_status { - CONTEXT_V2_ALERT_UNINITIALIZED = (1 << 5), // include UNINITIALIZED alerts - CONTEXT_V2_ALERT_UNDEFINED = (1 << 6), // include UNDEFINED alerts - CONTEXT_V2_ALERT_CLEAR = (1 << 7), // include CLEAR alerts - CONTEXT_V2_ALERT_RAISED = (1 << 8), // include WARNING & CRITICAL alerts - CONTEXT_V2_ALERT_WARNING = (1 << 9), // include WARNING alerts - CONTEXT_V2_ALERT_CRITICAL = (1 << 10), // include CRITICAL alerts -} CONTEXTS_V2_ALERT_STATUS; - -#define CONTEXTS_V2_ALERT_STATUSES (CONTEXT_V2_ALERT_UNINITIALIZED|CONTEXT_V2_ALERT_UNDEFINED|CONTEXT_V2_ALERT_CLEAR|CONTEXT_V2_ALERT_RAISED|CONTEXT_V2_ALERT_WARNING|CONTEXT_V2_ALERT_CRITICAL) - typedef enum __attribute__ ((__packed__)) rrdr_value_flag { // IMPORTANT: diff --git a/src/web/api/queries/ses/README.md b/src/web/api/queries/ses/README.md index e2fd65d7..58afdbe0 100644 --- a/src/web/api/queries/ses/README.md +++ b/src/web/api/queries/ses/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Single (or Simple) Exponential Smoothing (`ses`)" -sidebar_label: "Single (or Simple) Exponential Smoothing (`ses`)" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/ses/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Single (or Simple) Exponential Smoothing (`ses`) > This query is also available as `ema` and `ewma`. diff --git a/src/web/api/queries/stddev/README.md b/src/web/api/queries/stddev/README.md index 76cfee1f..62cda84f 100644 --- a/src/web/api/queries/stddev/README.md +++ b/src/web/api/queries/stddev/README.md @@ -1,12 +1,3 @@ -<!-- -title: "standard deviation (`stddev`)" -sidebar_label: "standard deviation (`stddev`)" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/stddev/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # standard deviation (`stddev`) The standard deviation is a measure that is used to quantify the amount of variation or dispersion diff --git a/src/web/api/queries/sum/README.md b/src/web/api/queries/sum/README.md index dd29b9c5..1bb71a62 100644 --- a/src/web/api/queries/sum/README.md +++ b/src/web/api/queries/sum/README.md @@ -1,12 +1,3 @@ -<!-- -title: "Sum" -sidebar_label: "Sum" -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/sum/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Sum This module sums all the values in the time-frame requested. diff --git a/src/web/api/queries/trimmed_mean/README.md b/src/web/api/queries/trimmed_mean/README.md index 96902329..66d86a53 100644 --- a/src/web/api/queries/trimmed_mean/README.md +++ b/src/web/api/queries/trimmed_mean/README.md @@ -1,13 +1,3 @@ -<!-- -title: "Trimmed Mean" -sidebar_label: "Trimmed Mean" -description: "Use trimmed-mean in API queries and health entities to find the average value from a sample, eliminating any unwanted spikes in the returned metrics." -custom_edit_url: https://github.com/netdata/netdata/edit/master/src/web/api/queries/trimmed_mean/README.md -learn_status: "Published" -learn_topic_type: "References" -learn_rel_path: "Developers/Web/Api/Queries" ---> - # Trimmed Mean The trimmed mean is the average value of a series excluding the smallest and biggest points. diff --git a/src/web/api/queries/weights.c b/src/web/api/queries/weights.c index 44928fea..e34774f3 100644 --- a/src/web/api/queries/weights.c +++ b/src/web/api/queries/weights.c @@ -4,9 +4,7 @@ #include "database/KolmogorovSmirnovDist.h" #define MAX_POINTS 10000 -int enable_metric_correlations = CONFIG_BOOLEAN_YES; int metric_correlations_version = 1; -WEIGHTS_METHOD default_metric_correlations_method = WEIGHTS_METHOD_MC_KS2; typedef struct weights_stats { NETDATA_DOUBLE max_base_high_ratio; @@ -36,7 +34,7 @@ WEIGHTS_METHOD weights_string_to_method(const char *method) { if(strcmp(method, weights_methods[i].name) == 0) return weights_methods[i].value; - return default_metric_correlations_method; + return WEIGHTS_METHOD_MC_KS2; } const char *weights_method_to_string(WEIGHTS_METHOD method) { @@ -44,7 +42,7 @@ const char *weights_method_to_string(WEIGHTS_METHOD method) { if(weights_methods[i].value == method) return weights_methods[i].name; - return "unknown"; + return "ks2"; } // ---------------------------------------------------------------------------- @@ -978,6 +976,12 @@ static size_t registered_results_to_json_multinode_group_by( BUFFER *key = buffer_create(0, NULL); BUFFER *name = buffer_create(0, NULL); dfe_start_read(results, t) { + char node_uuid[UUID_STR_LEN]; + + if(UUIDiszero(t->host->node_id)) + uuid_unparse_lower(t->host->host_id.uuid, node_uuid); + else + uuid_unparse_lower(t->host->node_id.uuid, node_uuid); buffer_flush(key); buffer_flush(name); @@ -998,7 +1002,7 @@ static size_t registered_results_to_json_multinode_group_by( if(!(qwd->qwr->group_by.group_by & RRDR_GROUP_BY_NODE)) { buffer_fast_strcat(key, "@", 1); buffer_fast_strcat(name, "@", 1); - buffer_strcat(key, t->host->machine_guid); + buffer_strcat(key, node_uuid); buffer_strcat(name, rrdhost_hostname(t->host)); } } @@ -1008,7 +1012,7 @@ static size_t registered_results_to_json_multinode_group_by( buffer_fast_strcat(name, ",", 1); } - buffer_strcat(key, t->host->machine_guid); + buffer_strcat(key, node_uuid); buffer_strcat(name, rrdhost_hostname(t->host)); } if(qwd->qwr->group_by.group_by & RRDR_GROUP_BY_CONTEXT) { diff --git a/src/web/api/queries/weights.h b/src/web/api/queries/weights.h index be7e5a8b..6d2bf8e0 100644 --- a/src/web/api/queries/weights.h +++ b/src/web/api/queries/weights.h @@ -18,9 +18,7 @@ typedef enum { WEIGHTS_FORMAT_MULTINODE = 3, } WEIGHTS_FORMAT; -extern int enable_metric_correlations; extern int metric_correlations_version; -extern WEIGHTS_METHOD default_metric_correlations_method; typedef bool (*weights_interrupt_callback_t)(void *data); |