首批通过分布式安全可靠测评,为关键业务系统打造
QPS
更新时间:2024-03-21 10:40:53
本节为您介绍 OceanBase 集群的性能指标 QPS (Query Per Second)。 QPS 指标用于统计集群每秒处理 SQL 语句的次数,该指标根据处理的 SQL 语句类型细分为如下几个子指标:all、select、insert、replace、update、delete、other。您可指定统计范围,查询 OceanBase 集群在单个 Zone 或 OBServer 节点的 QPS 数据。
all
指标介绍
OceanBase 集群每秒处理 SQL 语句的次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| all | sql_all_count | 次 |
计算表达式
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, 40002, 40004, 40006, 40008, 40018) 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, 40002, 40004, 40006, 40008, 40018) and (con_id > 1000 or con_id = 1) and class < 1000
select
指标介绍
每秒处理 SELECT 语句次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| select | sql_select_count | 次 |
计算表达式
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) 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) and (con_id > 1000 or con_id = 1) and class < 1000
insert
指标介绍
每秒处理 INSERT 语句次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| insert | sql_insert_count | 次 |
计算表达式
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) 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) and (con_id > 1000 or con_id = 1) and class < 1000
replace
指标介绍
每秒处理 REPLACE 语句次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| replace | sql_replace_count | 次 |
计算表达式
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) 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) and (con_id > 1000 or con_id = 1) and class < 1000
update
指标介绍
每秒处理 UPDATE 语句次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| update | sql_update_count | 次 |
计算表达式
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) 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) and (con_id > 1000 or con_id = 1) and class < 1000
delete
指标介绍
每秒处理 DELETE 语句次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| delete | sql_delete_count | 次 |
计算表达式
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) 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) and (con_id > 1000 or con_id = 1) and class < 1000
other
指标介绍
每秒处理 DDL、DCL、DTL 等其他语句次数。
指标参数说明
| 指标项 | 指标名称 | 单位 |
|---|---|---|
| other | sql_other_count | 次 |
计算表达式
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 (40018) 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 (40018) and (con_id > 1000 or con_id = 1) and class < 1000