SignalFx Developers Guide

lasting()

Use lasting() to combine the lasting argument and optionally the at_least argument to a when() function.

Syntax

lasting([lasting=duration][, at_least=percentage])

Table 1. Parameter definitions
Parameter Type Description

duration

string

Duration that indicates how long the when() predicate must be true before it returns true. The default is None, which specifies that when() is true as long as its predicate is met.
Durations are specified as a number followed by a single character:

  • s: seconds

  • m: minutes

  • h: hours

  • d: days

The default is None.

percentage

Decimal, 0.0 ≤ at_least =< 1.0

Indicates the percentage of lasting that the when() predicate must be true before it returns true. Allow you to specify and, or, and not logical operators. The default is 1.0

Examples

1
2
3
4
5
6
#Specifies that the when() predicate must be true for 50% of 5 minutes
my_lasting = lasting('5m', .5)

#When the stddev of memory.utilization is greater than .2 for 50% of 5 minutes
mem_stddev = data('memory.utilization').stddev()
when(mem_stddev > .2, my_lasting)

© Copyright 2019 SignalFx.

Third-party license information