SignalFx Developers Guide

fill()

fill fills in missing values for timeseries in a stream.

Syntax

fill(value=None, duration=None)

Table 1. Parameter definitions
Parameter Type Description

value

generic

Optional, default=None. If specified, the method uses value to replace missing values in the timeseries; otherwise, the method uses the last observed value for the timeseries.

duration

Duration (number and duration units indicator: "s" = seconds, "m" = minutes, "h" = hours)

Specifies the maximum continuous duration that the method applies the fill for a specific timeseries, after which the fill stops. If you don’t specify the duration, the fill continues as long as the timeseries is in the input stream.

As soon as the method detects reported values in the timeseries, it resets the fill duration.

The return value is a new data stream with missing values filled in.

Throws

  • Error if the fill value is not compatible with the stream type. For example, you can’t fill a numeric stream with a boolean value.

Error example

1
2
# counter example: this is an error
data('cpu.utilization').fill(value=False).publish()

Notes

The fill() method is similar to extrapolation in the data() function. The method fills the value at the same cadence as the computation itself, for example once per timeseries per iteration, and it doesn’t touch any actual values in the timeseries. Unlike extrapolation, you can apply fill anywhere in a data stream.

Use fill to provide substitute data when momentary gaps in the data occur. Use the duration argument to limit the fill duration so you avoid filling data indefinitely for a stopped or crashed server.

The method independently tracks the maximum fill duration specified in duration for each timeseries in the stream. If values occur sporadically in a timeseries, the fill method resets and restarts counting down the fill duration after each actual value. The method does the fill even if the fill duration only covers a small span of the iteration. For example, if the computation job runs at a resolution of 10 seconds and the fill duration is 12 seconds, the effective fill duration is 20 seconds.

The method only fills in data for timeseries that are included in the stream. In particular, timeseries that are no longer active or fail to match inclusion filters don’t get values filled.

Examples

1
2
3
4
5
6
7
8
#Fill with zero values.
data('num_errors').fill(0).publish()

#Fill with last value.
data('cpu.utilization').fill().publish()

#Fill with last value for a maximum duration
data('cpu.utilization').fill(duration='1m').publish()

© Copyright 2019 SignalFx.

Third-party license information