Commit 321c1c9b authored by Davor Cubranic's avatar Davor Cubranic

Note extrapolation done in the rate, delta, and increase

As suggested in prometheus/prometheus#2683.
parent 2fe53534
......@@ -89,7 +89,8 @@ month for each of the given times in UTC. Returned values are from 28 to 31.
`delta(v range-vector)` calculates the difference between the
first and last value of each time series element in a range vector `v`,
returning an instant vector with the given deltas and equivalent labels.
The delta is interpolated to cover the full time range.
The delta is interpolated to cover the full time range, so that it is
possible to get non-integer result even if the samples are all integers.
The following example expression returns the difference in CPU temperature
between now and 2 hours ago:
......@@ -202,7 +203,10 @@ equivalent labels.
`increase(v range-vector)` calculates the increase in the
time series in the range vector. Breaks in monotonicity (such as counter
resets due to target restarts) are automatically adjusted for.
resets due to target restarts) are automatically adjusted for. The
increment is interpolated to cover the full time range, so that it is
possible to get non-integer result even if counter increments only by
integers.
The following example expression returns the number of HTTP requests as measured
over the last 5 minutes, per time series in the range vector:
......@@ -212,8 +216,9 @@ increase(http_requests_total{job="api-server"}[5m])
```
`increase` should only be used with counters. It should be used primarily for
human readability. Use `rate` in recording rules so that increases are tracked
consistently on a per-second basis.
human readability and is really just a syntactic sugar around `rate` times the
number of seconds in the interval. Use `rate` in recording rules so that
increases are tracked consistently on a per-second basis.
## `irate()`
......@@ -299,7 +304,9 @@ regression](http://en.wikipedia.org/wiki/Simple_linear_regression).
`rate(v range-vector)` calculates the per-second average rate of increase of the
time series in the range vector. Breaks in monotonicity (such as counter
resets due to target restarts) are automatically adjusted for.
resets due to target restarts) are automatically adjusted for. Also, the
calculation extrapolates to the ends of the time range, allowing for missed
scrapes or imperfect alignment of scrape cycle with the range's time period.
The following example expression returns the per-second rate of HTTP requests as measured
over the last 5 minutes, per time series in the range vector:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment