SLAルール

このトピックでは、テストのSLAパフォーマンス目標を定義する方法について説明します。

このトピックの内容:

SLAルールについて

DevWebスクリプトテストのルールを定義して、AUTのパフォーマンスレベルがサービスレベルアグリーメント (SLA) の目標を満たしているかどうかを判断できます。スクリプトに関連付けるルールのしきい値を定義することにより、成功または失敗の基準を決定します。

テストが実行されるたびに、ルールが適用され、ルール計算の結果を示すレポートが作成されます。これにより、アプリケーションが最小パフォーマンスレベルを満たせなかった時点を特定できます。

注: SLAルールは、OpenText Performance Engineering for Developersでローカルに実行されるDevWebテストでのみサポートされます。

先頭に戻る

サポートされているルール

次のSLAルールがサポートされています。

  • トランザクション応答時間 (タイプ: averageTRT)。このルールは、テスト中のトランザクションの平均応答時間を測定し、それを定義されたしきい値 (averageTime、ミリ秒単位) と比較します。平均時間がこの値を超えると、SLAは失敗します。

    このルールは、複数のトランザクションに適用できます。

  • トランザクションの総数に対する失敗したトランザクション数 (タイプ: failureRate)。このルールは、テスト中のトランザクションの全体的な失敗率を測定します。失敗したトランザクションの割合が定義された割合 (1~100の整数) より大きい場合、SLAは失敗します。
  • 成功したトランザクション総数 (タイプ: passingTransactions)。このルールは、成功したトランザクションの合計量を定義されたしきい値量と比較します。数がしきい値を下回ると、SLAは失敗します。

  • トランザクションランクパーセンタイル (タイプ: TRP)。このルールは、渡されたトランザクションについて、定義されたパーセンタイルランクをトランザクション期間の範囲と比較します。目標パーセンテージに達していない場合、SLAは失敗します。

    TRPルールに指定されたトランザクションに対して、次の引数を定義します。

    引数 定義
    ranges 範囲 (ゼロから開始) は、ミリ秒 (ms) 単位の範囲マーカーを使用して定義されます。

    範囲マーカーが [2000、5000、10000] として定義されている場合、これは次の期間範囲を区切ります。

    • 0-2000 ms
    • 0-5000 ms
    • 0-10000 ms
    ranks これは、指定された各範囲に必要なパーセンタイルランクを定義します。範囲と同じ数のランクを定義する必要があります。

    ランクが [88、98、100] として定義されている場合、これは、SLAが成功するために次の結果が必要であることを意味します。

    • トランザクションの88%は、2000ミリ秒以下の期間である必要があります。
    • トランザクションの98%は、5000ミリ秒以下の期間である必要があります。
    • トランザクションの100%は、10000ミリ秒以下の期間である必要があります。

先頭に戻る

SLAルールの定義

SLAルールの基準は、sla_rules.ymlファイルで定義します。

テストを実行する前に、sla_rule.ymlをスクリプトフォルダーに追加します。ファイル内のルールが有効になっている場合、テスト実行の最後に、再生のサマリーに合格または失敗のステータスが表示され、レポートファイルが生成されます。

2つのレポート形式がサポートされています。

  • JUnit:: XMLファイル内のJUnitユニットテストフレームワークの形式。
  • TAP: TAPファイル内のTAPユニットテストフレームワークの形式。

SLAルールを使用してテストを実行するには:

  1. sla_rules.ymlファイルを<DevWeb root>\examples\SLAJUnitからスクリプトフォルダーにコピーします。
  2. sla_rules.ymlファイルを開いて内容を編集し、必要に応じて、スクリプトに関連するルールを追加します。以下のSLAルールファイルの例にある例の1つをガイドとして使用してください。

    transactionNameの値ごとに、スクリプトに表示されるトランザクションの名前を入力します。

    ファイル全体または個々のルールを有効または無効にすることができます。

  3. レポート設定を定義します。

    • 生成するレポートファイルのタイプ (reporterType): JUnitまたはTap
    • レポートの名前。JUnitレポートの場合は<name>.xml、TAPレポートの場合は<name>.tapの形式です。

    レポートはscriptフォルダー内に生成されます。

  4. テストを実行します。スクリプトの実行を参照してください。
  5. テストの最後に、SLAルールの結果を確認します (再生のサマリーの後)。

  6. スクリプトフォルダーを開き、JUnitまたはTAPレポートを見つけます。レポートを確認して、ルール計算の詳細を確認してください。

SLAルールファイルの例

sla_rules.ymlファイルの例:

enabled: true                                                   # Allows the user to enable or disable all the rules in a category
reporterType: JUnit                                             # Allows to change the reporter type, supported reporters: [JUnit, Tap]
reportName: sla_junit_report.xml                                # The report name, which is generated inside the script directory
rules:                                                          # List of the rules which the SLA enforces
  - rule: Transaction Response Time                             # The SLA rule measures the average duration of the given transactions
    type: averageTRT                                            # The transaction type
    enabled: true                                               # Allows the user to enable or disable a specific rule
    arguments:                                                  # The arguments which a given type is expecting (at least one entry)
      - transactionName: name1                                  # The name of the transaction for which we want to calculate the average
        threshold:                                              
        - averageTime: 1600                                     # The average time in milliseconds above which the SLA rule will fail
      - transactionName: name2                                  # The name of the transaction for which we want to calculate the average
        threshold: 
        - averageTime: 1650                                     # The average time in milliseconds above which the SLA rule will fail
  - rule: Transaction Response Time
    type: averageTRT
    enabled: false
    arguments: 
      - transactionName: example1
        threshold: 
        - averageTime: 100
      - transactionName: example2
        threshold: 
        - averageTime: 5000
  - rule: Failing Transactions to Total Transaction Ratio     # The SLA rule measures the percentage of total failed transactions
    type: failureRate                                         # The transaction type
    enabled: false                                            # Allows the user to enable or disable a specific rule
    arguments:                                                # The arguments which a given type is expecting (one entry)
      percentage: 10                                          # The percentage threshold above which the SLA rule will fail
  - rule: Total Passing Transactions                          # The SLA rule validates that the amount of passed transactions reach a minimum threshold.
    type: passingTransactions
    enabled: true
    arguments: 
      amount: 25                                              # The minimum amount of passed transactions for the SLA to pass.
  - rule: Transaction Rank Percentile                       # The SLA rule validates if transaction duration measurements meet percentile rank specified in the arguments.
    type: TRP                                                 
    enabled: true
    arguments: 
      - transactionName: name1                                # The name of the transaction for which we want to calculate the transaction percentile rank
        ranges: [2000, 5000, 10000]                           # Defines the duration ranges in milliseconds.For example, 5000 defines the range 0-5000.
        threshold:                                            # The number of threshold ranks must match the number of ranges.
          ranks: [88, 98, 100]                                # Defines the percentile ranks for the ranges.For example, 98% of transactions
								 are required to have a duration of 0-5000 milliseconds.

先頭に戻る

関連項目: