gt
Greater than operator. There are two variants of the :gt
operator.
Choosing¶
Input Stack:
|
⇨ | Output Stack:
|
This first variant is used for choosing the set of time series to operate on. It selects time series that have a value for a key that is greater than a specified value.
Parameters¶
- key: The tag key to compare (e.g.,
name
,nf.app
) - value: The value to compare against (comparison is lexicographic for strings)
Examples¶
Select time series where the name is lexicographically greater than "ssCpuSystem":
For example, consider the following query:
name,ssCpuSystem,:gt
When matching against the sample data in the table below, the highlighted time series would be included in the result set:
Name | nf.app | nf.node |
---|---|---|
ssCpuUser | alerttest | i-0123 |
ssCpuSystem | alerttest | i-0123 |
ssCpuUser | nccp | i-0abc |
ssCpuSystem | nccp | i-0abc |
numRequests | nccp | i-0abc |
ssCpuUser | api | i-0456 |
Math¶
Input Stack:
|
⇨ | Output Stack:
|
Compute a new time series where each interval has the value (a > b)
where a
and b
are the corresponding intervals in the input time series.
Parameters¶
- ts1: First time series expression (left operand)
- ts2: Second time series expression (right operand)
Examples¶
Numerical comparison of time series values:
Time | a | b | a > b |
---|---|---|---|
00:01 | 0.0 | 0.0 | 0.0 |
00:01 | 0.0 | 1.0 | 0.0 |
00:02 | 1.0 | 0.0 | 1.0 |
00:03 | 1.0 | 1.0 | 0.0 |
00:04 | 0.5 | 1.7 | 0.0 |
The result will be a signal time series that will
be 1.0
for intervals where the condition is true and 0.0
for intervals where it is false.
Comparing time expressions (minute of hour vs hour of day):
Before | After |
minuteOfHour,:time, hourOfDay,:time | minuteOfHour,:time, hourOfDay,:time, :gt |