Example:
auto trend = detectTrend(cpuHistory, 5.minutes);
if (trend == Trend.INCREASING) {
writeln("CPU usage is rising");
}Trend detectTrend(T)(MetricCollector!T collector, Duration window)Detects the trend in a metric collector over a time window.
Analyzes the values in the window to determine if the metric is increasing, decreasing, stable, or volatile.
T | The type of the metric value. |
collector | The MetricCollector to analyze. |
window | The time window to analyze. |
Example:
auto trend = detectTrend(cpuHistory, 5.minutes);
if (trend == Trend.INCREASING) {
writeln("CPU usage is rising");
}