Aggregate functions
Aggregate functions are time-dependent and are computed over a time interval. Aggregate functions include the
rate
function and functions with names that include the keyword
OverTime
. Aggregate functions must specify a time interval.
Transition and ratio calculations are not considered aggregate functions.
If the monitored URI includes parameters and the monitor is an aggregate function, the parameter must be passed to the aggregate function instead of to the
Monitor
function.
For example:
uri2 = '/rest/v1/system/interfaces/{}?attributes=statistics.rx_packets'
avg_m = AverageOverTime(uri2, "1 hour", [self.params['interface_id']])
self.m2 = Monitor(avg_m, 'Rx Packets')
In the examples of the functions,
uri2
is the following:
uri2 = '/rest/v1/system?attributes=resource_utilization_poll_interval'
The aggregate functions are the following:
CountOverTime
Counts the number of distinct time-series data points that have been generated during the specified period of time.
Example
CountOverTime
:count_over_m = CountOverTime(uri2, "5 minutes") self.m2 = Monitor( count_over_m, name='Resource Utilization Poll Interval')
SumOverTime
Calculates the sum of the monitored resource values that occurred during the specified period of time. When the monitored URI contains wildcard characters, this function sums over the current values of all resources pointed to by expanding the wildcards.
Example
SumOverTime
:sum_over_m = SumOverTime(uri2, "5 minutes") self.m10 = Monitor( sum_over_m, name='Resource Utilization Poll Interval')
MinOverTime
Calculates the minimum of the monitored resource values. When the monitored URI contains wildcard characters, this function returns the minimum value over the current values of all resources pointed to by expanding the wildcards.
Example
MinOverTime
:min_over_m = MinOverTime(uri2, "5 minutes") self.m2 = Monitor( min_over_m, name='Resource Utilization Poll Interval')
MaxOverTime
Calculates the maximum of the monitored resource values. When the monitored URI contains wildcard characters, this function returns the maximum value over the current values of all resources pointed to by expanding the wildcards.
Example:
MaxOverTime
:max_over_m = MaxOverTime(uri2, "5 minutes") self.m16 = Monitor( max_over_m, name='Resource Utilization Poll Interval')
AverageOverTime
Calculates the average of the monitored resource values over the specified period of time. When the monitored URI contains wildcard characters, this function calculates and returns the average value over the current values of all resources pointed to by expanding the wildcards.
Example
AverageOverTime
:avg_over_m = AverageOverTime(uri2, "5 minutes") self.m18 = Monitor( avg_over_m, name='Resource Utilization Poll Interval')
Rate
Calculates the per-second average rate of increase for the monitored resource value over the specified period of time. When the monitored URI contains wildcard characters, this function calculates the per-second average rate of increase for each of the monitored resources pointed to by expanding the wildcards.
Example:
rate_m = Rate(uri2, "5 minutes") self.m8 = Monitor(rate_m, name='Resource Utilization Poll Interval')
Time interval
The format of the time interval is the following:
"<number> <unit>"
The value for
<unit>
is one of the following:
second
seconds
minute
minutes
day
days
hour
hours
For example:
"12 seconds"