summaryrefslogtreecommitdiffstats
path: root/web/api/queries
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
commit517a443636daa1e8085cb4e5325524a54e8a8fd7 (patch)
tree5352109cc7cd5122274ab0cfc1f887b685f04edf /web/api/queries
parentReleasing debian version 1.42.4-1. (diff)
downloadnetdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.tar.xz
netdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.zip
Merging upstream version 1.43.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/queries')
-rw-r--r--web/api/queries/average/README.md4
-rw-r--r--web/api/queries/countif/README.md2
-rw-r--r--web/api/queries/des/README.md4
-rw-r--r--web/api/queries/incremental_sum/README.md4
-rw-r--r--web/api/queries/max/README.md4
-rw-r--r--web/api/queries/median/README.md4
-rw-r--r--web/api/queries/min/README.md4
-rw-r--r--web/api/queries/percentile/README.md4
-rw-r--r--web/api/queries/query.c16
-rw-r--r--web/api/queries/ses/README.md4
-rw-r--r--web/api/queries/stddev/README.md12
-rw-r--r--web/api/queries/trimmed_mean/README.md4
-rw-r--r--web/api/queries/weights.c6
13 files changed, 37 insertions, 35 deletions
diff --git a/web/api/queries/average/README.md b/web/api/queries/average/README.md
index c9aa402c..3a9c5393 100644
--- a/web/api/queries/average/README.md
+++ b/web/api/queries/average/README.md
@@ -21,10 +21,10 @@ average = sum(numbers) / count(numbers)
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: average -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/countif/README.md b/web/api/queries/countif/README.md
index 37b3f642..4004e7a2 100644
--- a/web/api/queries/countif/README.md
+++ b/web/api/queries/countif/README.md
@@ -31,7 +31,7 @@ The target number and the desired condition can be set using the `group_options`
## how to use
-This query cannot be used in alarms.
+This query cannot be used in alerts.
`countif` changes the units of charts. The result of the calculation is always from zero to 1, expressing the percentage of database points that matched the condition.
diff --git a/web/api/queries/des/README.md b/web/api/queries/des/README.md
index b12751a4..0cc1a918 100644
--- a/web/api/queries/des/README.md
+++ b/web/api/queries/des/README.md
@@ -46,10 +46,10 @@ You can change the fixed value `15` by setting in `netdata.conf`:
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: des -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/incremental_sum/README.md b/web/api/queries/incremental_sum/README.md
index 9b89f318..c882acba 100644
--- a/web/api/queries/incremental_sum/README.md
+++ b/web/api/queries/incremental_sum/README.md
@@ -15,10 +15,10 @@ The result may be positive (rising) or negative (falling) depending on the first
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: incremental_sum -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/max/README.md b/web/api/queries/max/README.md
index 82749c4a..e7ad5446 100644
--- a/web/api/queries/max/README.md
+++ b/web/api/queries/max/README.md
@@ -13,10 +13,10 @@ This module finds the max value in the time-frame given.
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: max -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/median/README.md b/web/api/queries/median/README.md
index 15549b3b..f1fb3a61 100644
--- a/web/api/queries/median/README.md
+++ b/web/api/queries/median/README.md
@@ -33,10 +33,10 @@ The function `trimmed-median` is an alias for `trimmed-median5`.
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: median -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/min/README.md b/web/api/queries/min/README.md
index cf63aaa0..67f3326e 100644
--- a/web/api/queries/min/README.md
+++ b/web/api/queries/min/README.md
@@ -13,10 +13,10 @@ This module finds the min value in the time-frame given.
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: min -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/percentile/README.md b/web/api/queries/percentile/README.md
index 19ec81ed..e0d21ee7 100644
--- a/web/api/queries/percentile/README.md
+++ b/web/api/queries/percentile/README.md
@@ -33,10 +33,10 @@ Any percentile may be requested using the `group_options` query parameter.
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: percentile95 -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/query.c b/web/api/queries/query.c
index 6f3cbd5f..8a4e94c9 100644
--- a/web/api/queries/query.c
+++ b/web/api/queries/query.c
@@ -1364,10 +1364,12 @@ static bool query_plan(QUERY_ENGINE_OPS *ops, time_t after_wanted, time_t before
if(!query_metric_is_valid_tier(qm, selected_tier))
return false;
+ }
- if(qm->tiers[selected_tier].db_first_time_s > before_wanted ||
- qm->tiers[selected_tier].db_last_time_s < after_wanted)
- return false;
+ if(qm->tiers[selected_tier].db_first_time_s > before_wanted ||
+ qm->tiers[selected_tier].db_last_time_s < after_wanted) {
+ // we don't have any data to satisfy this query
+ return false;
}
qm->plan.used = 1;
@@ -2201,7 +2203,7 @@ bool query_target_calculate_window(QUERY_TARGET *qt) {
}
// convert our before_wanted and after_wanted to absolute
- rrdr_relative_window_to_absolute(&after_wanted, &before_wanted, NULL, unittest_running);
+ rrdr_relative_window_to_absolute_query(&after_wanted, &before_wanted, NULL, unittest_running);
query_debug_log(":relative2absolute after %ld, before %ld", after_wanted, before_wanted);
if (natural_points && (options & RRDR_OPTION_SELECTED_TIER) && tier > 0 && storage_tiers > 1) {
@@ -2497,7 +2499,7 @@ static void query_group_by_make_dimension_key(BUFFER *key, RRDR_GROUP_BY group_b
}
if (group_by & RRDR_GROUP_BY_LABEL) {
- DICTIONARY *labels = rrdinstance_acquired_labels(qi->ria);
+ RRDLABELS *labels = rrdinstance_acquired_labels(qi->ria);
for (size_t l = 0; l < qt->group_by[group_by_id].used; l++) {
buffer_fast_strcat(key, "|", 1);
rrdlabels_get_value_to_buffer_or_unset(labels, key, qt->group_by[group_by_id].label_keys[l], "[unset]");
@@ -2545,7 +2547,7 @@ static void query_group_by_make_dimension_id(BUFFER *key, RRDR_GROUP_BY group_by
}
if (group_by & RRDR_GROUP_BY_LABEL) {
- DICTIONARY *labels = rrdinstance_acquired_labels(qi->ria);
+ RRDLABELS *labels = rrdinstance_acquired_labels(qi->ria);
for (size_t l = 0; l < qt->group_by[group_by_id].used; l++) {
if (buffer_strlen(key) != 0)
buffer_fast_strcat(key, ",", 1);
@@ -2600,7 +2602,7 @@ static void query_group_by_make_dimension_name(BUFFER *key, RRDR_GROUP_BY group_
}
if (group_by & RRDR_GROUP_BY_LABEL) {
- DICTIONARY *labels = rrdinstance_acquired_labels(qi->ria);
+ RRDLABELS *labels = rrdinstance_acquired_labels(qi->ria);
for (size_t l = 0; l < qt->group_by[group_by_id].used; l++) {
if (buffer_strlen(key) != 0)
buffer_fast_strcat(key, ",", 1);
diff --git a/web/api/queries/ses/README.md b/web/api/queries/ses/README.md
index 56634d36..a06f646e 100644
--- a/web/api/queries/ses/README.md
+++ b/web/api/queries/ses/README.md
@@ -34,10 +34,10 @@ You can change the fixed value `15` by setting in `netdata.conf`:
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: ses -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/stddev/README.md b/web/api/queries/stddev/README.md
index f0586a06..3f751a6e 100644
--- a/web/api/queries/stddev/README.md
+++ b/web/api/queries/stddev/README.md
@@ -18,10 +18,10 @@ out over a wider range of values.
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: stddev -1m unaligned of my_dimension
warn: $this > 1000
@@ -61,16 +61,16 @@ and its standard deviation is 100 (meaning that it variates from 900 to 1100), t
This is an easy way to check the % variation, without using absolute values.
-For example, you may trigger an alarm if your web server requests/sec `cv` is above 20 (`%`)
+For example, you may trigger an alert if your web server requests/sec `cv` is above 20 (`%`)
over the last minute. So if your web server was serving 1000 reqs/sec over the last minute,
-it will trigger the alarm if had spikes below 800/sec or above 1200/sec.
+it will trigger the alert if had spikes below 800/sec or above 1200/sec.
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: cv -1m unaligned of my_dimension
units: %
diff --git a/web/api/queries/trimmed_mean/README.md b/web/api/queries/trimmed_mean/README.md
index 08a32b83..328c4494 100644
--- a/web/api/queries/trimmed_mean/README.md
+++ b/web/api/queries/trimmed_mean/README.md
@@ -31,10 +31,10 @@ Any percentage may be requested using the `group_options` query parameter.
## how to use
-Use it in alarms like this:
+Use it in alerts like this:
```
- alarm: my_alarm
+ alarm: my_alert
on: my_chart
lookup: trimmed-mean5 -1m unaligned of my_dimension
warn: $this > 1000
diff --git a/web/api/queries/weights.c b/web/api/queries/weights.c
index 2782aef6..fce7b8f2 100644
--- a/web/api/queries/weights.c
+++ b/web/api/queries/weights.c
@@ -1806,7 +1806,7 @@ int web_api_v12_weights(BUFFER *wb, QUERY_WEIGHTS_REQUEST *qwr) {
}
};
- if(!rrdr_relative_window_to_absolute(&qwr->after, &qwr->before, NULL, false))
+ if(!rrdr_relative_window_to_absolute_query(&qwr->after, &qwr->before, NULL, false))
buffer_no_cacheable(wb);
else
buffer_cacheable(wb);
@@ -1823,7 +1823,7 @@ int web_api_v12_weights(BUFFER *wb, QUERY_WEIGHTS_REQUEST *qwr) {
if(qwr->baseline_before <= API_RELATIVE_TIME_MAX)
qwr->baseline_before += qwr->after;
- rrdr_relative_window_to_absolute(&qwr->baseline_after, &qwr->baseline_before, NULL, false);
+ rrdr_relative_window_to_absolute_query(&qwr->baseline_after, &qwr->baseline_before, NULL, false);
if (qwr->baseline_before <= qwr->baseline_after) {
resp = HTTP_RESP_BAD_REQUEST;
@@ -1913,7 +1913,7 @@ int web_api_v12_weights(BUFFER *wb, QUERY_WEIGHTS_REQUEST *qwr) {
if(qwd.interrupted) {
error = "interrupted";
- resp = HTTP_RESP_BACKEND_FETCH_FAILED;
+ resp = HTTP_RESP_CLIENT_CLOSED_REQUEST;
goto cleanup;
}