SignalFx Developers Guide

map()

Apply a lambda function to a stream.

Syntax

map(mapfn)

Table 1. Parameter definitions
Parameter Type Description

mapfn

lambda function

Lambda function to apply to metric timeseries in the input stream

Returns a reference to the input stream object.

Examples

1
2
3
4
5
6
#Apply a lambda function to a stream
data('cpu.utilization').map(lambda x: x / 2).mean().sum(over='1h')

#Same thing without lambda
utilization = data('cpu.utilization')
(utilization/2).mean().sum(over='1h')\n

© Copyright 2019 SignalFx.

Third-party license information