SignalFx Developers Guide

sum()

Calculates the sum of each metric timeseries in the input stream

Syntax

Aggregation

sum([by=grp])

Table 1. Parameter definitions
Parameter Type Description

grp

string or list of strings. Default is None.

Optional: Names of properties to group the results by

Transformation

sum(over=duration [,cycle=type][,cycle_start=index][,shift_cycles=shift][,partial_values=partials_flag])

Table 2. Parameter definitions
Parameter Type Description

duration

Duration (number and duration units)
Durations are specified as a number followed by a single character:

  • s: seconds

  • m: minutes

  • h: hours

  • d: days

The default is None.

Required: Duration over which to get the sum of the input stream. Required for a transformation

type

One of the following:

  • "quarter"

  • "month"

  • "week"

  • "day"

  • "hour"

The default is None.

Optional: Calendar duration over which to get the sum of the input stream.1

index

String or number, depending on the value of cycle

Optional: 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

Number. Default is 0.

Optional: 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.+ NOTE: If you specify shift_cycles=shift, partial_values must be False (the default).1

partials_flag

Boolean. Default is False.

Optional: 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

1 To learn more about calendar window transformations, see Calendar window transformations.

All forms return a reference to the input stream object.

Examples

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

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

#Transformation - sum over 1 hour
data('memory.utilization').sum(over='1h')

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

© Copyright 2019 SignalFx.

Third-party license information