SignalFx Developers Guide

random()

Get random values from the input stream by count or percentage

Syntax

random([count=count][, percentage=pct][, by=grp])

Table 1. Parameter definitions
Parameter Type Description

count

integer. Default is None.

Optional: Count of random inputs to pass through to the output. Mutually exclusive with percentage.

pct

Double,
0.0 < pct1.0
Default is None.

Optional: Percent of random inputs to pass through to the output. Mutually exclusive with count.

grp

string or list of strings. Default is None.

Optional: Names of properties to group the output by

Returns a reference to the input stream object.

Examples

1
2
3
4
5
6
7
8
#Return 5 random cpu utilization values
data('cpu.utilization').random(5)

#Return a random 5 percent of cpu utilization, grouped by 'env'
data('cpu.utilization').random(percentage=.05, by='env')

#Return 10 random cpu utilization values grouped by env and datacenter
data('cpu.utilization').random(10, by=['env', 'datacenter'])

© Copyright 2019 SignalFx.

Third-party license information