delta¶
Description¶
Calculates the value difference of the argument in each time bin for each group.
delta
may produce negative values when the argument decreases over time. See also delta_monotonic
.
When the argument is a metric defined using set_metric
, delta
behaves differently according to the specified metric type:
for
gauge
metrics,delta
retains the default behavior. Negatives may be produced when the value is decreasing.for
cumulativeCounter
metrics,delta
will assume the values to be monotonically increasing, and treats decreasing values as counter resets. Negatives will not be produced forcumulativeCounter
type metrics.for
delta
metrics,delta
will sum up the values in the time window to return the total sum. Negatives may be produced for negative input values.
Return type¶
value
Domain¶
This is an aggregate function (aggregates rows over a group in aggregate verbs.)
This is a window function (calculates over a group of multiple input rows using windowing.)
Categories¶
Usage¶
delta(value)
Argument |
Type |
Optional |
Repeatable |
Restrictions |
---|---|---|---|---|
value |
numeric or duration |
no |
no |
none |
Examples¶
align 5m, requests: delta(m("failures"))
Computes the delta of “failures” metric for each 5m time bins. The result may be positive or negative.