トレンド関数は、ヒストリー関数とは異なり、計算に トレンド データを使用します。
トレンドは1時間ごとの集計値を保存します。トレンド関数はこれらの1時間ごとの平均値を使用するため、 長期的な分析に役立ちます。
トレンド関数の結果はキャッシュされるため、同じ関数を同じパラメータで複数回呼び出しても、 データベースから情報は一度だけ取得されます。トレンド関数のキャッシュは、 TrendFunctionCacheSize サーバーパラメータによって制御されます。
トレンド関数を参照するトリガーは、式内の最小期間ごとに1回だけ評価されます。例えば、
のようなトリガーは、1日に1回評価されます。トリガーにトレンド関数と履歴関数(または 日付と時刻 と/または nodata())の両方が含まれている場合、 通常の原則に従って計算されます。
ここにリストされているすべての関数は、以下でサポートされています。
関数は追加情報なしでリストされています。関数をクリックすると、詳細が表示されます。
関数 | 説明 |
---|---|
baselinedev | 最後のデータ期間と、それ以前の季節の同じデータ期間との間の偏差の数(stddevpopアルゴリズムによる)を返します。 |
baselinewma | 加重移動平均アルゴリズムを使用して、複数の等しい期間(「季節」)の同じ期間のデータを平均化することで、ベースラインを計算します。 |
trendavg | 定義された期間内のトレンド値の平均 |
trendcount | 定義された期間内のトレンド値を計算するために使用された、正常に取得された履歴値の数 |
trendmax | 定義された期間内のトレンド値の最大値 |
trendmin | 定義された期間内のトレンド値の最小値 |
trendstl | 検出期間中の異常率を返します。これは 0 から 1 までの小数値で、((異常値の数)/(値の合計数)) となります。 |
trendsum | 定義された期間内のトレンド値の合計です。 |
/host/key
は一般的な必須の最初のパラメータですtime period:time shift
は一般的な 2 番目のパラメーターです。
関数のパラメータに関する一般的な注意事項:
<
>
で示されます。/host/key
および time period:time shift
パラメータは引用符で囲まないでください。最後のデータ期間と、それ以前の季節における同じデータ期間との間の偏差の数(stddevpopアルゴリズムによる)を返します。
パラメータ:
N
- 時間単位の数時間単位
- h (時)、d (日)、w (週)、M (月)、またはy (年)。季節以下である必要があります。例:
baselinedev(/host/key,1d:now/d,"M",6) # 前日と過去6ヶ月間の同日との間の標準偏差(人口)の数を計算します。前月に日付が存在しない場合は、その月の最終日が使用されます(7月31日は、1月31日、2月28日、…6月30日と比較されます)
baselinedev(/host/key,1h:now/h,"d",10) # 前10日間の期間における、前時間とその前の時間との間の標準偏差(人口)の数を計算します。
加重移動平均アルゴリズムを用いて、同じ期間(「季節」)のデータを複数の等しい期間で平均し、ベースラインを計算します。
パラメーター:
N
- 時間単位の数時間単位
- h (時)、d (日)、w (週)、M (月)、または y (年)。季節以下である必要があります。例:
baselinewma(/host/key,1h:now/h,"d",3) #昨日までの3日間の期間の最後の1時間に基づいてベースラインを計算します。「now」が月曜日の13:30の場合、金曜日、土曜日、日曜日の12:00~12:59のデータが分析されます。
baselinewma(/host/key,2h:now/h,"d",3) #昨日までの3日間の期間の最後の2時間に基づいてベースラインを計算します。 「現在」が月曜日の13:30の場合、金曜日、土曜日、日曜日の11:00~12:59のデータが分析されます。
baselinewma(/host/key,1d:now/d,"M",4) # 最終月の直前4か月間における「昨日」と同じ日付に基づいてベースラインを計算します。必要な日付が存在しない場合は、その月の最終日が使用されます。今日が9月1日の場合、7月31日、6月30日、5月31日、4月30日のデータが分析されます。
指定された期間内のトレンド値の平均値
パラメータ:
例:
trendavg(/host/key,1h:now/h) # 過去1時間の平均 (例: 12:00-13:00)
trendavg(/host/key,1h:now/h-1h) # 2時間前の平均 (11:00-12:00)
trendavg(/host/key,1h:now/h-2h) # 3時間前の平均 (10:00-11:00)
trendavg(/host/key,1M:now/M-1y) # 1年前の月の平均
定義された期間内でトレンド値を計算するために使用する、正常に取得された履歴値の数
パラメーター:
例:
trendcount(/host/key,1h:now/h) # 過去1時間の値の数 (例: 12:00-13:00)
trendcount(/host/key,1h:now/h-1h) # 2時間前 (11:00-12:00) の値の数
trendcount(/host/key,1h:now/h-2h) # 3時間前 (10:00-11:00) の値の数
trendcount(/host/key,1M:now/M-1y) # 1年前の前月の値の数
定義された期間内のトレンド値の最大値
パラメーター:
例:
trendmax(/host/key,1h:now/h) # 過去1時間の最大値 (例: 12:00-13:00)
trendmax(/host/key,1h:now/h) - trendmin(/host/key,1h:now/h) → 過去1時間 (12:00-13:00) の最大値と最小値の差 (トレンドデルタ) を計算します
trendmax(/host/key,1h:now/h-1h) # 2時間前 (11:00-12:00) の最大値
trendmax(/host/key,1h:now/h-2h) # 3時間前 (10:00-11:00) の最大値
trendmax(/host/key,1M:now/M-1y) # 1年前の先月の最大値
定義された期間内のトレンド値の最小値
パラメータ:
例:
trendmin(/host/key,1h:now/h) # 過去1時間の最小値 (例: 12:00-13:00)
trendmax(/host/key,1h:now/h) - trendmin(/host/key,1h:now/h) → 過去1時間 (12:00-13:00) の最大値と最小値の差 (トレンドデルタ) を計算します
trendmin(/host/key,1h:now/h-1h) # 2時間前 (11:00-12:00) の最小値
trendmin(/host/key,1h:now/h-2h) # 3時間前 (10:00-11:00) の最小値
trendmin(/host/key,1M:now/M-1y) # 1年前の先月の最小値
Returns the rate of anomalies during the detection period - a decimal value between 0 and 1 that is ((the number of anomaly values)/(total number of values))
.
Parameters:
N
- the number of time unitstime unit
- h (hour), d (day), w (week), M (month) or y (year)N
- the number of time unitstime unit
- h (hour), d (day), w (week)N
- the number of time unitstime unit
- h (hour), d (day), w (week)Examples:
trendstl(/host/key,100h:now/h,10h,2h) #analyse the last 100 hours of trend data, find the anomaly rate for the last 10 hours of that period, expecting the periodicity to be 2h, the remainder series values of the evaluation period are considered anomalies if they reach the value of 3 deviations of the MAD of that remainder series
trendstl(/host/key,100h:now/h-10h,100h,2h,2.1,"mad") #analyse the period of 100 hours of trend data, up to 10 hours ago, find the anomaly rate for that entire period expecting the periodicity to be 2h, the remainder series values of the evaluation period are considered anomalies if they reach the value of 2,1 deviations of the MAD of that remainder series
trendstl(/host/key,100d:now/d-1d,10d,1d,4,,10) #analyse 100 days of trend data up to a day ago, find the anomaly rate for the period of last 10d of that period, expecting the periodicity to be 1d, the remainder series values of the evaluation period are considered anomalies if they reach the value of 4 deviations of the MAD of that remainder series, overriding the default span of the loess window for seasonal extraction of "10 * number of entries in eval period + 1" with the span of 10 lags
trendstl(/host/key,1M:now/M-1y,1d,2h,,"stddevsamp") #analyse the previous month a year ago, find the anomaly rate of the last day of that period expecting the periodicity to be 2h, the remainder series values of the evaluation period are considered anomalies if they reach the value of 3 deviation of the sample standard deviation of that remainder series
指定された期間内のトレンド値の合計
パラメータ:
例:
trendsum(/host/key,1h:now/h) # 過去1時間の合計 (例: 12:00-13:00)
trendsum(/host/key,1h:now/h-1h) # 2時間前の合計 (11:00-12:00)
trendsum(/host/key,1h:now/h-2h) # 3時間前の合計 (10:00-11:00)
trendsum(/host/key,1M:now/M-1y) # 1年前の前月の合計
サポートされているすべての関数を参照してください。