Resample shortens a long series so a graph stays readable: the evaluated period is cut into equal time windows, and the points of each window become one point, dated at the start of the window.
It is set in the Reduce section of the editor:
- Resample target points: the number of windows, 60 by default
- Disable resample: every point is kept
Resample is the last step of a DPS, after Reduce. It only applies to a time series:
| Reduce scope | Resample |
|---|---|
| (none) | each raw series |
| Merged series | the merged series, see Merged series below |
| Single value, One per series | no effect: the result is already one value per series |
Resample never adds points: a series with no more points than Resample target points is returned as it is, and a window without any point is left out (the External API keeps it, empty).
How a window becomes one point
The window value follows the metric type and, with VALUE, the kind of the metric:
| Metric type | Kind | Window value |
|---|---|---|
| VALUE | average (response time, CPU %) | Σ(value × count) / Σcount |
| VALUE | interval counter (Responses Per Interval) |
sum |
| VALUE | fluctuating counter (Concurrent Invocations) |
highest |
| VALUE | other | average |
| MAX | any | highest |
| MIN | any | lowest |
| COUNT | any | sum: the number of values recorded in the window |
The new point carries the sum of the counts of its window.
- The kind is not chosen in the DPS: it is read from the metric (examples per kind in Metric semantics).
- An average without count (points from an older Enterprise Manager extension) gives a plain average.
The reduce function is never used: the reduce combines several series at one instant, resample combines one series over time.
Example, a Merged series with Sum of CPU %, resampled into 15 min windows:
| Window 10:00 → 10:15 | Value |
|---|---|
| 60 points of total CPU (Merged series, Sum), one every 15 s | about 45 % each |
| Window by kind (average) | 45 %: the total CPU over the window |
| Window with the reduce function Sum | 2,700 %: 60 instants added up |
Example
- Resample target points = 2 over 10:00:00 → 10:01:00: two windows of 30 s
- a point is dated at the end of the 15 s it covers: 10:00:30 goes to window 1, which ends there
| Window 1 10:00:00 → 10:00:30 |
Window 2 10:00:30 → 10:01:00 |
|||
|---|---|---|---|---|
| Point | 10:00:15 | 10:00:30 | 10:00:45 | 10:01:00 |
| Value | 1 | 2 | 3 | 4 |
| Count | 1 | 3 | 1 | 1 |
| Metric type, kind | Window 1, dated 10:00:00 | Window 2, dated 10:00:30 |
|---|---|---|
| VALUE, average | (1×1 + 2×3) / 4 = 1.75 | (3×1 + 4×1) / 2 = 3.5 |
| VALUE, interval counter | 1 + 2 = 3 | 3 + 4 = 7 |
| VALUE, fluctuating counter | 2 | 4 |
| VALUE, other | (1 + 2) / 2 = 1.5 | (3 + 4) / 2 = 3.5 |
| MAX / MIN | 2 / 1 | 4 / 3 |
| COUNT (the values are the counts) | 1 + 3 = 4 | 1 + 1 = 2 |
| Count carried by the new point | 4 | 2 |
A point before the period goes to the first window, a point after it to the last one.
Merged series
A Merged series can merge metrics of different kinds: its kind has to be determined, to pick its row in the resample table. The reduce function sets that kind, one for the whole merged series, and the count of each of its points.
| Reduce function | Merged value | Merged count | Kind used by resample |
|---|---|---|---|
| Sum | Σ value | highest count | kind of the series, other if their kinds differ |
| Average | average value | average count (a typical series) | kind of the series, other if their kinds differ |
| Average weighted | Σ(value × count) / Σcount | Σcount | kind of the series, other if their kinds differ |
| Sum weighted | Σ(value × count) | Σcount | interval counter: a total adds up over time |
| Max / Min | value of the selected series | count of the selected series | kind of the series, other if their kinds differ |
| Count series | number of series | highest count | other: a number of series is averaged |
Examples, with metric type VALUE:
| Merged series | Its kind | Row of the resample table |
|---|---|---|
| Sum of CPU % of 2 JVMs | average | Σ(value × count) / Σcount |
Sum of Responses Per Interval |
interval counter | sum |
Sum of Average Response Time + Responses Per Interval |
other: the kinds differ | average |
| Count series of any metric | other | average |
| Sum weighted of any metric | interval counter | sum |
The merged count only weighs the point with metric type VALUE on an average.