Function | Description |
CompareLastPeriod(metric, aggregation method, comparison result)
| Obtains the data compared with the previous period, for example, CompareLastPeriod(@cpu_total[60], '$Average', true) . If the average value of cpu_total in the current period is 20% and the average value of cpu_total in the previous period is 15%. the returned value of this function depends on the comparison result. If the comparison result is true , this function returns (20 - 15) × 100/20. If the comparison result is false , this function returns (15 - 20) × 100/20.
|
CompareLastHour(metric, aggregation method, comparison result)
| Obtains the data compared with the previous hour. CompareLastHour(@cpu_total[60], '$Average', true) > 10 : If the average value of cpu_total increases by 10% compared with yesterday, an alert is triggered.
|
CompareLastWeek(metric, aggregation method, comparison result)
| Obtains the data compared with yesterday. CompareYesterday(@cpu_total[60], '$Average', true) > 10 : If the average value of cpu_total increases by 10% compared with the previous week, an alert is triggered.
|
CompareLastWeek(metric, aggregation method, comparison result)
| Obtains the data compared with the previous week. CompareLastWeek(@cpu_total[60], '$Average', true) > 10 : If the average value of cpu_total increases by 10% compared with the previous week, an alert is triggered.
|
ComparePast(metric, aggregation method, comparison result, seconds)
| Obtains the data compared with the specified number of seconds prior to the current time. The preceding four functions are simplified forms of this function. CompareLastHour(@cpu_total[60], '$Average', true) is equivalent to ComparePast(@cpu_total[60], '$Average', true, 3600) .
CompareYesterday(@cpu_total[60], '$Average', true) is equivalent to ComparePast(@cpu_total[60], '$Average', true, 24*60*60) .
CompareLastWeek(@cpu_total[60], '$Average', true) is equivalent to ComparePast(@cpu_total[60], '$Average', true, 7*24*60*60) .
|