Reduce is optional. It runs right after Values filtering, on the filtered raw points, and combines them according to a scope (how many series are combined together) and a function (how values are combined). Without a reduce scope, the raw filtered values are returned (optionally resampled).

Which scope and function to pick for a need: see Use cases.

Scope: Single value

Single value flattens every point from every matched series into a single list, then reduces once — the result is a single number for the whole DPS, regardless of how many series matched.

Example: 2 series are selected, with metric type VALUE and Effective metric only unchecked: an empty cell has no sample.

Under each series, its count is the number of times the metric was recorded at that timestamp.

Reduce function 10:00:00 10:00:15 10:00:30 10:00:45 10:01:00 Result
agentA:metricA 10 30 24 30
agentA:metricA count 4 1 1 2
agentB:metricB 5 44 40 57
agentB:metricB count 1 1 4 1
Average 10 30, 5 24, 44 40 30, 57 (10+30+5+24+44+40+30+57)/8 = 30
Average weighted 10×4 30×1, 5×1 24×1, 44×1 40×4 30×2, 57×1 (40+30+5+24+44+160+60+57)/15 = 28
Sum weighted 10×4 30×1, 5×1 24×1, 44×1 40×4 30×2, 57×1 40+30+5+24+44+160+60+57 = 420
Sum 10 30, 5 24, 44 40 30, 57 10+30+5+24+44+40+30+57 = 240
Max 10 30, 5 24, 44 40 30, 57 57
Min 10 30, 5 24, 44 40 30, 57 5
Count series 1 2 2 1 2 8 (points, not the sum of their counts: see the sum of the counts below)
First, Last, Plateau detection max / min not valid: refused when saving, and disabled in the editor

Sum of the counts. The number of calls or samples behind the points is obtained with metric type COUNT, which takes each point’s count as its value, and the Sum function: here 4+1+1+2+1+1+4+1 = 15.

Sum weighted adds value × count. With metric type VALUE on an average per call (response time), it gives the total time of the calls; with MAX, MIN or COUNT, or on a counter, the editor preview warns that the result has no meaning.

Why First, Last and Plateau detection are not valid for Single value. They read the points of one series in time order. Single value mixes the points of every series: the sequence 10, 30, 5, 24, 44, 40, 30, 57 alternates agentA and agentB, so its first point, last point or plateau depends on which agent reported when. They are obtained per series with One per series.

If nothing matched at all, Count series returns 0; every other function returns no value.

Resample has no effect on this scope.

Scope: One per series

One per series reduces each matched series independently — one result value per series, no flattening across series.

The result is one row per series.

  • a function that selects a point (Max, Min, First, Last) also gives its timestamp
  • Plateau detection max / min gives the start of the plateau
  • a function that combines points (Average, Average weighted, Sum, Count series) gives none.

With the series below:

Function Result
Max [agentA:metricA, 30, 10:00:15]
[agentB:metricB, 57, 10:01:00]
Average [agentA:metricA, 23.5]
[agentB:metricB, 36.5]
Plateau detection max [agentA:metricA, 27, 10:00:15]
[agentB:metricB, 43.5, 10:00:30]

Using the same two series as above, still with metric type VALUE, straight from the raw filtered points:

Reduce function 10:00:00 10:00:15 10:00:30 10:00:45 10:01:00 Result
agentA:metricA 10 30 24 30
agentA:metricA count 4 1 1 2
agentB:metricB 5 44 40 57
agentB:metricB count 1 1 4 1
Average 10 30, 5 24, 44 40 30, 57 agentA: (10+30+24+30)/4 = 23.5
agentB: (5+44+40+57)/4 = 36.5
Average weighted 10×4 30×1, 5×1 24×1, 44×1 40×4 30×2, 57×1 agentA: (40+30+24+60)/8 = 19.25
agentB: (5+44+160+57)/7 = 38
Sum weighted 10×4 30×1, 5×1 24×1, 44×1 40×4 30×2, 57×1 agentA: 40+30+24+60 = 154
agentB: 5+44+160+57 = 266
Sum 10 30, 5 24, 44 40 30, 57 agentA: 94
agentB: 146
Max 10 30, 5 24, 44 40 30, 57 agentA: 30 (the earliest of the two)
agentB: 57
Min 10 30, 5 24, 44 40 30, 57 agentA: 10
agentB: 5
Count series 1 2 2 1 2 agentA: 4
agentB: 4 (points, not the sum of their counts: see the sum of the counts below)
First 10 30, 5 24, 44 40 30, 57 agentA: 10
agentB: 5
Last 10 30, 5 24, 44 40 30, 57 agentA: 30
agentB: 57
Plateau detection max
(30 s window for the example)
10 30, 5 24, 44 40 30, 57 agentA: (30+24)/2 = 27
agentB: (44+40×4+57)/6 = 43.5
Plateau detection min
(30 s window for the example)
10 30, 5 24, 44 40 30, 57 agentA: (10×4+30)/5 = 14
agentB: (5+44)/2 = 24.5

Sum of the counts. Metric type COUNT and the Sum function give, per series: agentA 4+1+1+2 = 8, agentB 1+1+4+1 = 7.

The plateau rows use a 30 s window to fit the example: see Plateau detection for the real window and how a plateau is found. agentA’s 30 at 10:01:00 is not in its plateau: no sample at 10:00:45 ends it.

A series with nothing to reduce is dropped, not shown as empty, except with Count series, which shows 0.

Resample has no effect on this scope.

Scope: Merged series

The Merged series scope merges every matched series into a single serie (not a single value) by grouping points across series by exact shared timestamp, and reducing each timestamp’s group independently. The result has one point per distinct timestamp seen across the input.

Example with the same series, still with metric type VALUE. Each function row is the merged series: one point per timestamp column.

Reduce function 10:00:00 10:00:15 10:00:30 10:00:45 10:01:00 Result
agentA:metricA 10 30 24 30
agentA:metricA count 4 1 1 2
agentB:metricB 5 44 40 57
agentB:metricB count 1 1 4 1
Average 10 17.5 34 40 43.5 merged series
Average weighted 10 (30+5)/2 = 17.5 (24+44)/2 = 34 40 (30×2+57)/3 = 39 merged series
Sum weighted 10×4 = 40 30+5 = 35 24+44 = 68 40×4 = 160 30×2+57 = 117 merged series
Sum 10 35 68 40 87 merged series
Max 10 30 44 40 57 merged series
Min 10 5 24 40 30 merged series
Count series 1 2 2 1 2 merged series: how many series had a point at that timestamp, not the sum of their counts (see the sum of the counts below)
First, Last, Plateau detection max / min not valid: refused when saving, and disabled in the editor

Average weighted gives at each timestamp Σ(value × count) / Σcount.

Sum of the counts. Metric type COUNT and the Sum function give, per timestamp: 4, 1+1 = 2, 1+1 = 2, 4, 2+1 = 3.

Why First, Last and Plateau detection are not valid for Merged series. The reduce is applied per timestamp, to one column: its values share the same instant.

  • First / Last: the first or last value of a column has no meaning, its values have no time order.
  • Plateau detection: a plateau is a level held over time; 10:00:15 alone, with agentA 30 and agentB 5, holds no plateau.

They are obtained per series with One per series.

Resample of the merged series

Resample, if configured, applies afterward. Unlike Single value/One per series, Merged series still produces a full time series (one point per timestamp) rather than a single scalar — so an optional Resample target points runs next, bucketing this merged series down. See Resample.

The merged series is resampled like a raw series of its kind, never with the reduce function: see Resample of a merged series.

Name of the merged series

Shown in the graph legend and the CSV header. Each metric path is cut into segments on | and :, and the name is picked as follows:

  • one series only, or identical metric paths: that metric path
  • otherwise the common segments (found exactly once in every metric path), when every path holds them in the same order
  • otherwise, when they come in different orders, the longest run of at least two of them that every path holds one directly after the other
  • otherwise the common segment first in every path, else the one last in every path
  • the DPS display name when nothing remains, or when no remaining segment holds a letter or a digit

In the name, each run of other segments of any path is replaced by one %. A % in the middle keeps the separators around it (Apps|%|Called backends), a % at the start or the end is glued to the name (%MyServer2%). Separators come from the first metric path. Only the metric path is compared (not the agent), and series left without any point by the value selector are ignored.

Metric paths Name
Hpa|X|Hpa
Hpa|X|Hpa
Hpa|X|Hpa
Frontends|Apps|MyServer1|Called backends|remoteTrade
Frontends|Apps|MyServer2|Called backends|remoteTrade
Frontends|Apps|%|Called backends|remoteTrade
Frontends|Apps|MyServer1|Called backends|remoteTrade
MyServer2|Called backends|remoteTrade
%Called backends|remoteTrade
Frontends|Apps|MyServer2|Called backends|remoteTrade
Hpa|MyServer2|Hello
%MyServer2%
Alpha|Beta|Gamma|Delta
Beta|Alpha|Gamma|Delta
%Gamma|Delta (Alpha and Beta swapped)
Frontends|Apps|X:Errors
Apps|Frontends|Y:Errors
%Errors (no shared run, Errors last in both)
Apps|Login
Login|Apps
DPS display name (opposite orders)
Frontends|Apps
Backends|Oracle
DPS display name (no common segment)

Sum and Count of a clocked metric

Every point carries a count. It has two possible meanings:

  • per-call metric (response time, errors): count = number of calls in the 15 s interval. It follows the traffic.
  • clocked metric (CPU): count = number of samples in the 15 s interval, taken at regular times by the agent, for example CPU:Utilization % (process). An interval with a lower count than the others covers only part of the 15 s.

For a clocked metric, the count estimates the coverage of a series: its count over the count of a complete interval.

Counting a clocked metric for its coverage is not possible yet with the DPS reduce functions: only the External API, Process CPU does it.

The Batch starts at 10:00:20, covering 2/3 of the 10:00:15 interval, and ends at 10:01:05, covering 1/3 of the 10:01:00 one: 4 samples in the first interval, 6 in the full ones, then 2.

The key is the full count: it turns a count into a share of the interval. The DPS does not identify it yet.

Interval 10:00:15 10:00:30 10:01:00 10:01:15
Host CPU (%), SystemEdge (count 1) 37 47 27 17
DataServer CPU average (%) 15 15 15 15
DataServer CPU count 6 6 6 6
Batch CPU average (%) 30 30 30 —
Batch CPU count 4 6 2 —
Weighted sum / full count (15×6 + 30×4) / 6 = 35 45 (15×6 + 30×2) / 6 = 25 15
Sum 15 + 30 = 45
⚠ above host CPU (37)
45 15 + 30 = 45
⚠ above host CPU (27)
15
Count series 2 2 2 1
  • Weighted sum / full count = Σ(value × count) / full count

In this example, the full count is 6: the count of a complete 15 s interval.

Function validity by scope

Function Single value One per series Merged series
Average Yes Yes Yes
Average weighted Yes Yes Yes
Sum weighted Yes Yes Yes
Sum Yes Yes Yes
Max Yes Yes Yes
Min Yes Yes Yes
Count series Yes Yes Yes
First No — refused when saving, and disabled in the editor Yes (earliest point in time, per series) No — refused when saving, and disabled in the editor
Last No — refused when saving, and disabled in the editor Yes (latest point in time, per series) No — refused when saving, and disabled in the editor
Plateau detection max / min No — refused when saving, and disabled in the editor Yes No — refused when saving, and disabled in the editor

Plateau detection

Plateau detection max finds the highest level : the busy stretch of a CPU idle most of the time

Plateau detection min the lowest : the lowest free swap.

The result is the average of that detection, dated at its start.

  1. 1st pass find the window with the highest (lowest) average, at least 5 min long when the series spans 2 h or less, 15 min beyond. With metric type VALUE, each point weighs its count, as in Average weighted; with MAX, MIN or COUNT, every point weighs the same.
  2. 2nd pass: extend the detected window on both sides, one point at a time, while the average of the whole stretch stays within 10 % of the core average.

A plateau ends where two points do not follow each other (more than one slot apart) or at a point with count 0:

  • process restart: no point for the slots it lasts
  • agent silent, Effective metric only checked: its count-0 points are removed, so no point either
  • agent silent, Effective metric only unchecked: its points have count 0

If no window reaches the minimum length, the series has no plateau and is left out of the result.

Effective metric only

While an agent stays connected but reports nothing, each slot is recorded with value 0 and count 0. Effective metric only removes those points. The other examples of this page leave it unchecked and show slots with no sample at all; here agentA is silent at 10:00:45 instead:

agentA:metricA 10:00:00 10:00:15 10:00:30 10:00:45 10:01:00 Average Min Count series
Effective metric only unchecked 10 30 24 0 (count 0) 30 (10+30+24+0+30)/5 = 18.8 0 5
Effective metric only checked 10 30 24 30 (10+30+24+30)/4 = 23.5 10 4

Average weighted and Sum do not change: a point with count 0 weighs nothing and adds 0. A plateau ends at 10:00:45 in both cases.