このセクションでは、テナントのOBKV_Tableタイプのモニタリング項目であるパフォーマンスメトリクス 応答時間(RT) について説明します。レスポンス時間とは、サーバーが単一のSQLを処理するのにかかる時間を指し、具体的にはサーバーがSQLリクエストを受信してから、そのSQLの実行が終了するまでの時間を指します。統計範囲を指定することで、単一のZoneまたはOBServerノードにおけるテナントのOBKV_Tableタイプの 応答時間(RT) データを照会できます。
all
指標の紹介
SQLステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| all | obkv_table_sql_all_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="190002",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190102",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190202",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190302",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190402",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190502",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191102",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191202",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191302",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190004",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190104",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190204",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190304",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190404",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190504",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191104",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191204",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191304",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190902",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190905",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="190001",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190101",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190201",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190301",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190401",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190501",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191101",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191201",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191301",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190003",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190103",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190203",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190303",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190403",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190503",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191103",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191203",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191303",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190901",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190904",@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 (190002, 190102, 190202, 190302, 190402, 190502, 191102, 191202, 191302, 190004, 190104, 190204, 190304, 190404, 190504, 191104, 191204, 191304, 190902, 190905, 190001, 190101, 190201, 190301, 190401, 190501, 191101, 191201, 191301, 190003, 190103, 190203, 190303, 190403, 190503, 191103, 191203, 191303, 190901, 190904) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以上のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190002, 190102, 190202, 190302, 190402, 190502, 191102, 191202, 191302, 190004, 190104, 190204, 190304, 190404, 190504, 191104, 191204, 191304, 190902, 190905, 190001, 190101, 190201, 190301, 190401, 190501, 191101, 191201, 191301, 190003, 190103, 190203, 190303, 190403, 190503, 191103, 191203, 191303, 190901, 190904) and (con_id > 1000 or con_id = 1)
select
指標の紹介
SELECTステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| select | obkv_table_sql_select_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="190002",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190004",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190902",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="190001",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190003",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190901",@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 (190002, 190004, 190902, 190001, 190003, 190901) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以上のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190002, 190004, 190902, 190001, 190003, 190901) and (con_id > 1000 or con_id = 1)
insert
指標の紹介
INSERTステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| insert | obkv_table_sql_insert_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="190102",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190402",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191302",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190104",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190404",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191304",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="190101",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190401",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191301",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190103",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190403",@LABELS}[@INTERVAL])) by (@GBLABELS) R_FILL_0_ADD sum(rate(ob_sysstat{stat_id="191303",@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 (190102, 190402, 191302, 190104, 190404, 191304, 190101, 190401, 191301, 190103, 190403, 191303) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以上のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190102, 190402, 191302, 190104, 190404, 191304, 190101, 190401, 191301, 190103, 190403, 191303) and (con_id > 1000 or con_id = 1)
update
指標の紹介
UPDATEステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| update | obkv_table_sql_update_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="190302",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191102",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191202",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190304",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191104",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191204",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="190301",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191101",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191201",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190303",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191103",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="191203",@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 (190302, 191102, 191202, 190304, 191104, 191204, 190301, 191101, 191201, 190303, 191103, 191203) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190302, 191102, 191202, 190304, 191104, 191204, 190301, 191101, 191201, 190303, 191103, 191203) and (con_id > 1000 or con_id = 1)
replace
指標紹介
REPLACEステートメントの平均処理時間。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| replace | obkv_table_sql_replace_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="190502",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190504",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="190501",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190503",@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 (190502, 190504, 190501, 190503) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190502, 190504, 190501, 190503) and (con_id > 1000 or con_id = 1)
delete
指標紹介
DELETEステートメントの平均処理時間。
指標パラメータ説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| delete | obkv_table_sql_delete_rt | μs |
計算式
(sum(rate(ob_sysstat{stat_id="190202",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190204",@LABELS}[@INTERVAL])) by (@GBLABELS)) / (sum(rate(ob_sysstat{stat_id="190201",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="190203",@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 (190202, 190204, 190201, 190203) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190202, 190204, 190201, 190203) and (con_id > 1000 or con_id = 1)
query and mutate
指標の紹介
Query and mutateステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| query and mutate | obkv_table_sql_query_mutate_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="190905",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="190904",@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 (190905, 190904) and (con_id > 1000 or con_id = 1)OceanBase V4.0以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190905, 190904) and (con_id > 1000 or con_id = 1)
other
指標の紹介
DDL、DCL、DTLなどその他のステートメントの平均処理時間です。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| other | obkv_table_sql_other_rt | μs |
計算式
sum(rate(ob_sysstat{stat_id="190702",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="190701",@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 (190702, 190701) and (con_id > 1000 or con_id = 1)OceanBase V4.0 以降のバージョン:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (190702, 190701) and (con_id > 1000 or con_id = 1)
99-all
指標の紹介
SQLステートメントの平均処理時間TP99。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| 99-all | obkv_table_sql_all_rt_tp99 | μs |
計算式
histogram_quantile(0.99, sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI SELECT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI INSERT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI UPDATE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI REPLACE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI QUERY AND MUTATE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI OTHER", @LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
WITH histogram_data AS (SELECT t1.tenant_id, t1.svr_ip, t1.sql_type, 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 gv$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 gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t1 ON 1=1 INNER JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$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', 'INNER SQL', 'TABLEAPI SELECT', 'TABLEAPI INSERT', 'TABLEAPI DELETE', 'TABLEAPI UPDATE', 'TABLEAPI REPLACE', 'TABLEAPI QUERY AND MUTATE', 'TABLEAPI OTHER', 'HBASE SCAN', 'HBASE PUT', 'HBASE DELETE', 'HBASE APPEND', 'HBASE INCREMENT', 'HBASE CHECK AND PUT', 'HBASE CHECK AND DELETE', 'HBASE HYBRID BATCH', 'REDIS SET', 'REDIS GET', 'REDIS HSET', 'REDIS HGET', 'REDIS LPUSH', 'REDIS LPOP', 'REDIS SADD', 'REDIS ZADD') GROUP BY t1.response_time, t1.tenant_id, t1.sql_type) SELECT * FROM (SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type NOT LIKE 'TABLEAPI %' AND sql_type NOT LIKE 'HBASE %' AND sql_type NOT LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type = sql_type AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'TABLEAPI %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'TABLEAPI %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'HBASE %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'HBASE %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'REDIS %' AND cumulative_count > 0)) all_histogram_data ORDER BY tenant_id, svr_ip, sql_type, response_time
95-all
指標の紹介
SQL文の平均処理時間TP95。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| 95-all | obkv_table_sql_all_rt_tp95 | μs |
計算式
histogram_quantile(0.95, sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI SELECT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI INSERT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI UPDATE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI REPLACE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI QUERY AND MUTATE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI OTHER", @LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
WITH histogram_data AS (SELECT t1.tenant_id, t1.svr_ip, t1.sql_type, 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 gv$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 gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t1 ON 1=1 INNER JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$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', 'INNER SQL', 'TABLEAPI SELECT', 'TABLEAPI INSERT', 'TABLEAPI DELETE', 'TABLEAPI UPDATE', 'TABLEAPI REPLACE', 'TABLEAPI QUERY AND MUTATE', 'TABLEAPI OTHER', 'HBASE SCAN', 'HBASE PUT', 'HBASE DELETE', 'HBASE APPEND', 'HBASE INCREMENT', 'HBASE CHECK AND PUT', 'HBASE CHECK AND DELETE', 'HBASE HYBRID BATCH', 'REDIS SET', 'REDIS GET', 'REDIS HSET', 'REDIS HGET', 'REDIS LPUSH', 'REDIS LPOP', 'REDIS SADD', 'REDIS ZADD') GROUP BY t1.response_time, t1.tenant_id, t1.sql_type) SELECT * FROM (SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type NOT LIKE 'TABLEAPI %' AND sql_type NOT LIKE 'HBASE %' AND sql_type NOT LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type = sql_type AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'TABLEAPI %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'TABLEAPI %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'HBASE %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'HBASE %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'REDIS %' AND cumulative_count > 0)) all_histogram_data ORDER BY tenant_id, svr_ip, sql_type, response_time
90-all
指標の紹介
SQL文の平均処理時間TP90。
指標パラメータの説明
メトリクス項目 |
指標名 |
単位 |
|---|---|---|
| 90-all | obkv_table_sql_all_rt_tp90 | μs |
計算式
histogram_quantile(0.90, sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI SELECT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI INSERT", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI DELETE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI UPDATE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI REPLACE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI QUERY AND MUTATE", @LABELS}[@INTERVAL])) by (@GBLABELS,le) FILL_0_ADD sum(rate(ob_query_rt_cumulative_count{sql_type="TABLEAPI OTHER", @LABELS}[@INTERVAL])) by (@GBLABELS,le))
SQL収集
WITH histogram_data AS (SELECT t1.tenant_id, t1.svr_ip, t1.sql_type, 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 gv$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 gv$ob_query_response_time_histogram GROUP BY response_time, tenant_id, svr_ip, sql_type) t1 ON 1=1 INNER JOIN (SELECT tenant_id, svr_ip, sql_type, response_time, SUM(count) AS total_count, SUM(total) AS total_value FROM gv$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', 'INNER SQL', 'TABLEAPI SELECT', 'TABLEAPI INSERT', 'TABLEAPI DELETE', 'TABLEAPI UPDATE', 'TABLEAPI REPLACE', 'TABLEAPI QUERY AND MUTATE', 'TABLEAPI OTHER', 'HBASE SCAN', 'HBASE PUT', 'HBASE DELETE', 'HBASE APPEND', 'HBASE INCREMENT', 'HBASE CHECK AND PUT', 'HBASE CHECK AND DELETE', 'HBASE HYBRID BATCH', 'REDIS SET', 'REDIS GET', 'REDIS HSET', 'REDIS HGET', 'REDIS LPUSH', 'REDIS LPOP', 'REDIS SADD', 'REDIS ZADD') GROUP BY t1.response_time, t1.tenant_id, t1.sql_type) SELECT * FROM (SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type NOT LIKE 'TABLEAPI %' AND sql_type NOT LIKE 'HBASE %' AND sql_type NOT LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type = sql_type AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'TABLEAPI %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'TABLEAPI %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'HBASE %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'HBASE %' AND cumulative_count > 0) UNION SELECT tenant_id, svr_ip, sql_type, response_time, cumulative_count FROM histogram_data WHERE sql_type LIKE 'REDIS %' AND EXISTS (SELECT 1 FROM histogram_data g WHERE g.sql_type LIKE 'REDIS %' AND cumulative_count > 0)) all_histogram_data ORDER BY tenant_id, svr_ip, sql_type, response_time