このセクションでは、OceanBaseテナントのパフォーマンスメトリクスである 応答時間(RT) について説明します。レスポンス時間とは、サーバーが単一のSQLを処理するためにかかる時間であり、具体的にはサーバーがSQLリクエストを受信してからそのSQLの実行が終了するまでの時間を指します。統計範囲を指定することで、テナントの単一ゾーンまたはOBServerノードにおける 応答時間(RT) のデータを照会できます。
all
指標の紹介
サーバーが各SQLステートメントを処理する平均時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| all | sql_all_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="40001",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40003",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40005",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40007",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40009",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="40019",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="40000",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40002",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40004",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40006",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="40008",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="40018",@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 ( 40000, 40001, 40002, 40003, 40004, 40005, 40006, 40007, 40008, 40009, 40018, 40019) 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 (40000, 40001, 40002, 40003, 40004, 40005, 40006, 40007, 40008, 40009, 40018, 40019) and (con_id > 1000 or con_id = 1) and class < 1000
select
指標の紹介
サーバーが各SELECTステートメントを処理する平均時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| select | sql_select_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40001",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40000",@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 (40000, 40001) 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 (40000, 40001) and (con_id > 1000 or con_id = 1) and class < 1000
insert
指標の紹介
サーバーが各INSERTステートメントを処理する平均時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| insert | sql_insert_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40003",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40002",@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 (40002, 40003) 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 (40002, 40003) and (con_id > 1000 or con_id = 1) and class < 1000
update
指標の紹介
サーバーが各UPDATEステートメントを処理する平均時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| update | sql_update_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40007",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40006",@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 (40006, 40007) 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 (40006, 40007) and (con_id > 1000 or con_id = 1) and class < 1000
replace
指標の紹介
サーバーが各replaceステートメントを処理する平均時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| replace | sql_replace_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40005",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40004",@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 (40004, 40005) 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 (40004, 40005) and (con_id > 1000 or con_id = 1) and class < 1000
delete
指標の紹介
サーバーが各Deleteステートメントを処理する平均時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| delete | sql_delete_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40009",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40008",@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 (40008, 40009) 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 (40008, 40009) and (con_id > 1000 or con_id = 1) and class < 1000
other
指標の紹介
サーバーが各DDL、DCL、DTLなどその他のステートメントを処理する平均時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| other | sql_other_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40019",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40000",@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 (40000, 40019) 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 (40000, 40019) and (con_id > 1000 or con_id = 1) and class < 1000
99-all
指標の紹介
SQLステートメントの平均処理時間TP99。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| 99-all | sql_all_rt_tp99 | μs |
計算式
histogram_quantile(0.99, sum(rate(ob_query_rt_total_cumulative_count{@LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
OceanBase V4.2.1.7以降、V4.2.2.0未満のバージョン:
select tenant_id, svr_ip, response_time, cumulative_count from (select t1.tenant_id, t1.svr_ip, (case when t1.response_time >= t0.max_rt then '+Inf' else t1.response_time * 1000000 end) as response_time, t1.total_count, t1.total_value * 1000000 as total_value, sum(t2.total_count) as cumulative_count, sum(t2.total_value) * 1000000 as cumulative_value from (select max(response_time) as max_rt from v$ob_query_response_time_histogram) t0 join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t1 inner join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t2 on t1.response_time >= t2.response_time and t1.tenant_id = t2.tenant_id and t1.svr_ip = t2.svr_ip and t1.sql_type = t2.sql_type where t1.svr_ip = ? and t1.sql_type in ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER') group by t1.response_time, t1.tenant_id)OceanBase V4.2.5.0以降、V4.3.0.0未満のバージョン:
select tenant_id, svr_ip, response_time, cumulative_count from (select t1.tenant_id, t1.svr_ip, (case when t1.response_time >= t0.max_rt then '+Inf' else t1.response_time * 1000000 end) as response_time, t1.total_count, t1.total_value * 1000000 as total_value, sum(t2.total_count) as cumulative_count, sum(t2.total_value) * 1000000 as cumulative_value from (select max(response_time) as max_rt from v$ob_query_response_time_histogram) t0 join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t1 inner join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t2 on t1.response_time >= t2.response_time and t1.tenant_id = t2.tenant_id and t1.svr_ip = t2.svr_ip and t1.sql_type = t2.sql_type where t1.svr_ip = ? and t1.sql_type in ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER') group by t1.response_time, t1.tenant_id)OceanBase V4.3.4.1以降のバージョン:
select tenant_id, svr_ip, response_time, cumulative_count from (select t1.tenant_id, t1.svr_ip, (case when t1.response_time >= t0.max_rt then '+Inf' else t1.response_time * 1000000 end) as response_time, t1.total_count, t1.total_value * 1000000 as total_value, sum(t2.total_count) as cumulative_count, sum(t2.total_value) * 1000000 as cumulative_value from (select max(response_time) as max_rt from v$ob_query_response_time_histogram) t0 join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t1 inner join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t2 on t1.response_time >= t2.response_time and t1.tenant_id = t2.tenant_id and t1.svr_ip = t2.svr_ip and t1.sql_type = t2.sql_type where t1.svr_ip = ? and t1.sql_type in ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER') group by t1.response_time, t1.tenant_id)
95-all
指標の紹介
SQLステートメントの平均処理時間TP95。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| 95-all | sql_all_rt_tp95 | μs |
計算式
histogram_quantile(0.95, sum(rate(ob_query_rt_total_cumulative_count{@LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
OceanBase V4.2.1.7以降、V4.2.2.0未満のバージョン:
select tenant_id, svr_ip, response_time, cumulative_count from (select t1.tenant_id, t1.svr_ip, (case when t1.response_time >= t0.max_rt then '+Inf' else t1.response_time * 1000000 end) as response_time, t1.total_count, t1.total_value * 1000000 as total_value, sum(t2.total_count) as cumulative_count, sum(t2.total_value) * 1000000 as cumulative_value from (select max(response_time) as max_rt from v$ob_query_response_time_histogram) t0 join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t1 inner join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t2 on t1.response_time >= t2.response_time and t1.tenant_id = t2.tenant_id and t1.svr_ip = t2.svr_ip and t1.sql_type = t2.sql_type where t1.svr_ip = ? and t1.sql_type in ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER') group by t1.response_time, t1.tenant_id)OceanBase V4.2.5.0以降、V4.3.0.0未満のバージョン:
select tenant_id, svr_ip, response_time, cumulative_count from (select t1.tenant_id, t1.svr_ip, (case when t1.response_time >= t0.max_rt then '+Inf' else t1.response_time * 1000000 end) as response_time, t1.total_count, t1.total_value * 1000000 as total_value, sum(t2.total_count) as cumulative_count, sum(t2.total_value) * 1000000 as cumulative_value from (select max(response_time) as max_rt from v$ob_query_response_time_histogram) t0 join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t1 inner join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t2 on t1.response_time >= t2.response_time and t1.tenant_id = t2.tenant_id and t1.svr_ip = t2.svr_ip and t1.sql_type = t2.sql_type where t1.svr_ip = ? and t1.sql_type in ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER') group by t1.response_time, t1.tenant_id)OceanBase V4.3.4.1以降のバージョン:
select tenant_id, svr_ip, response_time, cumulative_count from (select t1.tenant_id, t1.svr_ip, (case when t1.response_time >= t0.max_rt then '+Inf' else t1.response_time * 1000000 end) as response_time, t1.total_count, t1.total_value * 1000000 as total_value, sum(t2.total_count) as cumulative_count, sum(t2.total_value) * 1000000 as cumulative_value from (select max(response_time) as max_rt from v$ob_query_response_time_histogram) t0 join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t1 inner join (select tenant_id, svr_ip, sql_type, response_time, sum(count) as total_count, sum(total) as total_value from v$ob_query_response_time_histogram group by response_time, tenant_id, svr_ip, sql_type) t2 on t1.response_time >= t2.response_time and t1.tenant_id = t2.tenant_id and t1.svr_ip = t2.svr_ip and t1.sql_type = t2.sql_type where t1.svr_ip = ? and t1.sql_type in ('SELECT', 'INSERT', 'DELETE', 'UPDATE', 'REPLACE', 'COMMIT', 'OTHER') group by t1.response_time, t1.tenant_id)
commit
コミットステートメントの平均処理時間。
指標パラメータ説明
指標項目 |
指標名 |
単位 |
|---|---|---|
| commit | sql_commit_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40026",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40025",@LABELS}[@INTERVAL])) by (@GBLABELS)'
取得SQL
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40025, 40026) and (con_id > 1000 or con_id = 1) and con_id in (select tenant_id from DBA_OB_TENANTS WHERE tenant_type<>'META')
rollback
ロールバックステートメントの平均処理時間。
指標パラメータ説明
指標項目 |
指標名 |
単位 |
|---|---|---|
| rollback | sql_rollback_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="40028",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="40027",@LABELS}[@INTERVAL])) by (@GBLABELS)
取得SQL
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (40027, 40028) and (con_id > 1000 or con_id = 1) and con_id in (select tenant_id from DBA_OB_TENANTS WHERE tenant_type<>'META')