このセクションでは、OceanBaseテナントのモニタリング指標であるSQL実行時間について説明します。この指標は、SQL実行時間ごとに、現在の統計範囲内のローカルSQL実行時間、リモートSQL実行時間、および分散SQL実行時間を監視します。統計範囲を指定することで、単一ゾーンまたはOBServerノード上のテナントのSQL実行時間データを照会できます。
local
指標の概要
統計範囲内のローカルSQLの実行時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| local | sql_local_time | μs |
計算式
sum(rate(ob_sysstat{stat_id="40116",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40010",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V3.2.4.1以降、V4.0未満のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40010, 40116) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40010, 40116) and (con_id > 1000 or con_id = 1) and class < 1000
remote
指標の概要
統計範囲内のリモートSQLの実行時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| remote | sql_remote_time | μs |
計算式
sum(rate(ob_sysstat{stat_id="40117",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40011",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V3.2.4.1以降、V4.0未満のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40011, 40117) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase V3.2.4.1以降、V4.0以上のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40011, 40117) and (con_id > 1000 or con_id = 1) and class < 1000
distributed
指標の紹介
統計範囲内での分散SQLの実行時間を示します。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| distributed | sql_distributed_time | μs |
計算式
sum(rate(ob_sysstat{stat_id="40118",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40012",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL収集
OceanBase V3.2.4.1以降、V4.0未満のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40012, 40118) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase V4.0以上のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40012, 40118) and (con_id > 1000 or con_id = 1) and class < 1000