タイムド・オペレーションと JDBC 呼び出し
タイムド・オペレーション (操作の実行時間の監視) では、アプリケーション・サーバーの JDBC 呼び出しの動作が予想より遅いまたは速いときに、ログ警告を生成します。
概要
タイムド・オペレーション・フィーチャーは、有効にされると、 アプリケーション・サーバーで実行されている JDBC 操作の所要時間を追跡します。 操作の実行時間が予想よりも長いまたは短い場合に、タイムド・オペレーション・フィーチャーは警告を記録します。 タイムド・オペレーション・フィーチャーでは定期的に、実行に最も長く時間がかかった操作を詳述したレポートをアプリケーション・サーバー・ログに作成します。 server dump コマンドを実行すると、タイムド・オペレーション・フィーチャーは、追跡したすべての操作に関する情報が入ったレポートを生成します。 これらのレポートにリストされた情報を使用して、予想より実行が遅いまたは速い操作があるどうかを判別することができます。
システムは定期的に、タイムド・オペレーションで監視した最長 10 件の JDBC 操作を含むレポートをログに生成します。 このレポートの頻度と有効化は server.xml ファイルで構成可能で、デフォルトは 1 日 (24 時間) に 1 回です。
タイムド・オペレーションを有効にするには、server.xml ファイルに timedOperations-1.0 フィーチャーを追加します。
以下の例に示した timedOperation エレメントを使用して、 ログへのレポート生成を使用不可にしたり、レポートの頻度を例えば 12 時間ごとに 1 回に変更したりすることができます。
<timedOperation enableReport="false" reportFrequency="12" />
<timedOperation enableReport="false" reportFrequency="12" maxNumberTimedOperations="10000"/>
この例では、タイムド・オペレーションの数が 10000 を超えると、以下のようにログに警告メッセージが生成されます。[4/18/13 23:01:37:316 EDT] 0000002c com.ibm.wsspi.timedoperations.TimedOperationService W TRAS0094I:
The total number of timed operations is 10000, which exceeds the configured maximum number of 10000.
You can also find the number of timed operations in the report that is periodically generated to the logs.
If you find that the number of timed operations is excessive, you can disable the timed operations feature.
![[8.5.5.2 以降]](../ng_v8552.gif)
TRAS0095I: 時間指定操作の総数が、構成された最大である 10000 に達しました。新しい時間指定操作が作成される時は、このレベルで追跡された時間指定操作の総数を維持するために、最長未使用時間の時間指定操作が削除されます。
また、server dump コマンドを使用して、すべての時間指定操作の完全レポートを messages.log ファイルに取得することもできます。時間指定操作はタイプによってグループ化され、各グループ内では実際の所要時間の平均によってソートされます。
以下の例は、サンプルのログ・メッセージを示しています。
[3/14/13 14:01:25:960 CDT] 00000025 TimedOperatio W TRAS0080W: Operation websphere.datasource.execute:
jdbc/exampleDS:insert into cities values ('myHomeCity', 106769, 'myHomeCountry') took 1.541 ms to complete,
which was longer than the expected duration of 0.213 ms based on past observations.
以下の例は、 ログに自動生成されたレポートのサンプルを示しています。
[12/13/12 7:42:29:509 CST] 0000001d com.ibm.wsspi.timedoperations.TimedOperationService I TRAS0092I:
The following operations took the longest time to run since the last report has been generated:
Operation websphere.datasource.execute:jdbc/exampleDS:insert into cities values ('myHomeCity',
106769, 'myHomeCounty') took 194ms to complete
Operation websphere.datasource.execute:jdbc/exampleDS:select county from cities where name=
'myHomeCity' took 187ms to complete
Operation websphere.datasource.execute:jdbc/exampleDS:drop table cities took 182ms to
complete¥Operation websphere.datasource.execute:jdbc/exampleDS:insert into cities values
('myHomeCity', 106769, 'myHomeCounty') took 151ms to complete
タイムド・オペレーション構成の詳細な参照情報については、 『server.xml ファイルの構成エレメント』のトピック内の timedOperation エレメントを参照してください。