This is a translation of the original English documentation page. Help us make it better.

5 トレンド関数

トレンド関数は、ヒストリー関数とは異なり、計算に トレンド データを使用します。

トレンドは1時間ごとの集計値を保存します。トレンド関数はこれらの1時間ごとの平均値を使用するため、 長期的な分析に役立ちます。

トレンド関数の結果はキャッシュされるため、同じ関数を同じパラメータで複数回呼び出しても、 データベースから情報は一度だけ取得されます。トレンド関数のキャッシュは、 TrendFunctionCacheSize サーバーパラメータによって制御されます。

トレンド関数を参照するトリガーは、式内の最小期間ごとに1回だけ評価されます。例えば、

trendavg(/host/key,1d:now/d) > 1 または trendavg(/host/key2,1w:now/w) > 2

のようなトリガーは、1日に1回評価されます。トリガーにトレンド関数と履歴関数(または 日付と時刻 と/または nodata())の両方が含まれている場合、 通常の原則に従って計算されます。

ここにリストされているすべての関数は、以下でサポートされています。

関数は追加情報なしでリストされています。関数をクリックすると、詳細が表示されます。

関数 説明
baselinedev 最後のデータ期間と、それ以前の季節の同じデータ期間との間の偏差の数(stddevpopアルゴリズムによる)を返します。
baselinewma 加重移動平均アルゴリズムを使用して、複数の等しい期間(「季節」)の同じ期間のデータを平均化することで、ベースラインを計算します。
trendavg 定義された期間内のトレンド値の平均
trendcount 定義された期間内のトレンド値を計算するために使用された、正常に取得された履歴値の数
trendmax 定義された期間内のトレンド値の最大値
trendmin 定義された期間内のトレンド値の最小値
trendstl 検出期間中の異常率を返します。これは 0 から 1 までの小数値で、((異常値の数)/(値の合計数)) となります。
trendsum 定義された期間内のトレンド値の合計です。
共通パラメータ
  • /host/key は一般的な必須の最初のパラメータです
  • time period:time shift は一般的な 2 番目のパラメーターです。
    • time period - 期間 (最小 '1h')、<N><時間単位> として定義、'N' - 時間単位の数、'時間単位' - h (時間) d (日)、w (週)、M (月)、または y (年)。
    • time shift - 期間のオフセット (関数の例を参照)

関数の詳細

関数のパラメータに関する一般的な注意事項:

  • 関数のパラメータはカンマで区切ります。
  • オプションの関数パラメータ(またはパラメータ部分)は、< > で示されます。
  • 関数固有のパラメータは、各関数で説明します。
  • /host/key および time period:time shift パラメータは引用符で囲まないでください。
baselinedev(/host/key,データ期間:時間シフト,季節単位,季節数)

最後のデータ期間と、それ以前の季節における同じデータ期間との間の偏差の数(stddevpopアルゴリズムによる)を返します。

パラメータ:

  • 共通パラメータを参照してください。
  • データ期間 - 季節内のデータ収集期間。<N><時間単位>で定義されます。
    N - 時間単位の数
    時間単位 - h (時)、d (日)、w (週)、M (月)、またはy (年)。季節以下である必要があります。
  • 季節単位 - 1季節の長さ (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日間の期間における、前時間とその前の時間との間の標準偏差(人口)の数を計算します。
baselinewma(/host/key,データ期間:時間シフト,季節単位,季節数)

加重移動平均アルゴリズムを用いて、同じ期間(「季節」)のデータを複数の等しい期間で平均し、ベースラインを計算します。

パラメーター:

  • 共通パラメーター を参照してください。
  • データ期間 - 季節内のデータ収集期間。<N><時間単位> で定義されます。ここで:
    N - 時間単位の数
    時間単位 - h (時)、d (日)、w (週)、M (月)、または y (年)。季節以下である必要があります。
    時間シフト - 期間のオフセット。季節におけるデータ収集期間の終了を定義します (例を参照)
  • 季節単位 - 1季節の期間 (h、d、w、M、y)。これより小さい値は指定できません。データ期間より長い;
  • num seasons - 評価する季節の数

例:

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,time period:time shift)

指定された期間内のトレンド値の平均値

パラメータ:

例:

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,time period:time shift)

定義された期間内でトレンド値を計算するために使用する、正常に取得された履歴値の数

パラメーター:

例:

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,time period:time shift)

定義された期間内のトレンド値の最大値

パラメーター:

例:

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,time period:time shift)

定義された期間内のトレンド値の最小値

パラメータ:

例:

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年前の先月の最小値
trendstl(/host/key,eval period:time shift,detection period,season,<deviations>,<devalg>,<s window>)

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:

  • See common parameters;
  • eval period - the time period that must be decomposed (minimum '1h'), defined as <N><time unit> where
    N - the number of time units
    time unit - h (hour), d (day), w (week), M (month) or y (year)
  • detection period - the time period before the end of eval period for which anomalies are calculated (minimum '1h', cannot be longer than eval period), defined as <N><time unit> where
    N - the number of time units
    time unit - h (hour), d (day), w (week)
  • season - the shortest time period where a repeating pattern ("season") is expected (minimum '2h', cannot be longer than eval period, the number of entries in the eval period must be greater than the two times of the resulting frequency (season/h)), defined as <N><time unit> where
    N - the number of time units
    time unit - h (hour), d (day), w (week)
  • deviations - the number of deviations (calculated by devalg) to count as anomaly (can be decimal), (must be greater than or equal to 1, default is 3);
  • devalg (must be double-quoted) - the deviation algorithm, can be stddevpop, stddevsamp or mad (default);
  • s window - the span (in lags) of the loess window for seasonal extraction (default is 10 * number of entries in eval period + 1)

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,time period:time shift)

指定された期間内のトレンド値の合計

パラメータ:

例:

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年前の前月の合計

サポートされているすべての関数を参照してください。