stddev() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.50 is the most recent stable version of Flux.

The stddev() function computes the standard deviation of non-null records in a specified column.

Function type: Aggregate
Output data type: Float

stddev(
  column: "_value",
  mode: "sample"
)

Parameters

column

The column on which to operate. Defaults to "_value".

Data type: String

mode

The standard deviation mode or type of standard deviation to calculate. Defaults to "sample".

Data type: String

The available options are:

sample

Calculates the sample standard deviation where the data is considered to be part of a larger population.

population

Calculates the population standard deviation where the data is considered a population of its own.

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> filter(fn: (r) =>
    r._measurement == "cpu" and
    r._field == "usage_system"
  )
  |> stddev()

STDDEV()