SignalFx Developers Guide

mean()

Calculates the mean of metric timeseries in the input stream

Syntax

Aggregation

mean(by=None)

Table 1. Parameter definitions
Parameter Type Description

by

string or list of strings

Optional, default=None. Names of properties to group the output by

Transformation

mean(over=None | [cycle=<cycle_duration>][,cycle_start=<start_point>][,shift_cycles=0][,partial_values=False])

Table 2. Transformation parameter definitions
Parameter Type Description

1 To learn more about calendar window transformations, see Using SignalFlow.

over

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

Duration over which to get the average of the input stream

cycle

One of "quarter", "month", "week", "day", "hour"

Clock or calendar duration over which to get the average of the input stream.1

cycle_start

String or number, depending on the value of cycle

Index within cycle at which the transformation starts. The default is the first position within cycle. Format depends on the value of cycle.1
NOTE: You can’t specify cycle_start if you specify "cycle": "hour"

shift_cycles

Number

Shifts the cycle window a number of cycles back from the current time and day. For example, cycle=hour and shift_cycles=1 shifts the window to the previous hour. Default is 0.
NOTE: If you specify shift_cycles, partial_values must be False (the default).1

partial_values

Boolean

If True, SignalFlow emits partial results during the time period of cycle; otherwise, SignalFlow only emits a result at the end of the cycle. Default is False.
NOTE: If you specify partial_values=True, you can’t use shift_cycles.1

All forms return a reference to the input stream object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#Aggregation - mean by env
data('cpu.utilization').mean(by='env')

#Aggregation - mean by env and datacenter
data('cpu.utilization').mean(by=['env', 'datacenter'])

#Transformation - mean over 1 hour
data('cpu.utilization').mean(over='1h')

#Transformation - Average over last day, starting at 6:00 AM
#Emit values during the period
data('cpu.utilization').mean(cycle="day", cycle_start="06h", partial_values=True)

© Copyright 2019 SignalFx.

Third-party license information