このセクションでは、OceanBaseテナントのモニタリング指標であるTPS(Transactions Per Second)について説明します。TPSとは、テナントが1秒間に処理するトランザクション数を指します。OCPでは、TPSをより詳細に分類した指標を提供しており、以下のものが含まれます:all(1秒間に処理するトランザクション数)、 trans_commit_count(1秒間にコミットされるトランザクション数)、 trans_rollback_count(1秒間にロールバックされるトランザクション数)、 trans_timeout_count(1秒間にタイムアウトするトランザクション数)。統計範囲を指定することで、単一ゾーンまたはOBServerノード上のテナントのTPSデータを照会できます。
all
指標の紹介
統計範囲内で、テナントが1秒間に処理するトランザクションの総数です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| TPS | tps | times/s |
計算式
sum(rate(ob_sysstat{stat_id="30005",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
OceanBase V4.0未満のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30005) 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 (30005) and (con_id > 1000 or con_id = 1) and class < 1000
trans_commit_count
指標の紹介
統計範囲内で、テナントが1秒間にコミットするトランザクション数です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| TPS | transaction_commit_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="30007",@LABELS}[@INTERVAL])) by (@GBLABELS)
クエリの取得
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30007) 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 (30007) and (con_id > 1000 or con_id = 1) and class < 1000
trans_rollback_count
指標の説明
統計範囲内で、テナントが1秒間にロールバックするトランザクション数を示します。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| TPS | transaction_rollback_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="30009",@LABELS}[@INTERVAL])) by (@GBLABELS)
クエリの取得
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30009) 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 (30009) and (con_id > 1000 or con_id = 1) and class < 1000
trans_timeout_count
指標の説明
統計範囲内で、テナントが1秒間にタイムアウトするトランザクション数を示します。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| TPS | transaction_timeout_count | times/s |
計算式
sum(rate(ob_sysstat{stat_id="30011",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
OceanBase V4.0 より前のバージョン:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30011) 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 (30011) and (con_id > 1000 or con_id = 1) and class < 1000