pow()
Was this page helpful?
Raise each value in each MTS in the input stream to an exponent, or
raise a base to the value in each MTS in the input. In mathematical
terms, pow()
can perform either one of these calculations:
#Return metric^exponent result=pow(exponent) #Return base^metric result=pow(base=metric)
To use
pow()
you need to specify one of the two forms, but they’re mutually exclusive.
Syntax
Invoke the pow
method using one of two forms:
Exponent form
pow(exponent)
Parameter definitions
Parameter | Type | Description |
---|---|---|
exponent | integer | Required: Exponent to apply to each value of each MTS in the input stream |
Base form
pow([base=base_value])
Parameter definitions
Parameter | Type | Description |
---|---|---|
base | number | Required: Specify as a keyword argument. A value that’s raised by the metric value in each MTS in the input stream |
Examples
#The square of cpu.utilization data('cpu.utilization').pow(2).publish() #Raise 2 to value of each metric in the input stream. #The input metrics have only two values: 0 or 1 #Output will be either 2 or 1 data('zero_or_one_data').pow(base=2).publish()