add
Input Stack:ts2: TimeSeriesExpr | ts1: TimeSeriesExpr |
|
⇨ |
Output Stack:(ts1 + ts2): TimeSeriesExpr | |
|
Compute a new time series where each interval has the value (a addNaN b)
where a
and b
are the corresponding intervals in the input time series. Sample:
:add |
3.0 |
0.0 |
1.0 |
1.0 |
NaN |
Input 1 |
1.0 |
0.0 |
1.0 |
1.0 |
NaN |
Input 2 |
2.0 |
0.0 |
0.0 |
NaN |
NaN |
Use the fadd operator to get strict floating point behavior.
Examples
Example adding a constant:
Before | After |
| |
name,sps,:eq,
30e3
| name,sps,:eq,
30e3,:add
|
Example adding two series:
Before | After |
| |
name,requestLatency,:eq,
:sum,
name,requestsPerSecond,:eq,
:max,
(,name,),:by
| name,requestLatency,:eq,
:sum,
name,requestsPerSecond,:eq,
:max,
(,name,),:by,
:add
|