SignalFx Developers Guide

random()

Get random values from the input stream by count or percentage

Syntax

random(count=None, percentage=None, by=None)

Table 1. Parameter definitions
Parameter Type Description

count

integer

Optional, default=None. Count of random inputs to pass through to the output. Mutually exclusive with percentage.

percentage

Double with a value between 0.0 (exclusive) and 1.0 (inclusive)

Optional, default=None. Percent of random inputs to pass through to the output. Mutually exclusive with count.

by

string or list of strings

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