sub

Input Stack:
ts2: TimeSeriesExpr
ts1: TimeSeriesExpr
Output Stack:
(ts1 - ts2): TimeSeriesExpr
 

Compute a new time series where each interval has the value (a subtractNaN b) where a and b are the corresponding intervals in the input time series.

:sub 1.0 0.0 1.0 1.0 NaN
Input 1 2.0 0.0 1.0 1.0 NaN
Input 2 1.0 0.0 0.0 NaN NaN

Use the fsub operator to get strict floating point behavior.

Example subtracting a constant:

BeforeAfter
name,sps,:eq
name,sps,:eq,
30e3,:sub

Example subtracting two series:

BeforeAfter
name,requestLatency,:eq,
:sum,
name,requestsPerSecond,:eq,
:max,
(,name,),:by
name,requestLatency,:eq,
:sum,
name,requestsPerSecond,:eq,
:max,
(,name,),:by,
:sub