暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

QPS OceanBase工具学习笔记282

数据库新手 2023-06-21
443

欢迎访问 OceanBase 官网获取更多信息:https://www.oceanbase.com/

指标介绍

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 < 1000
  • OceanBase V4.0 及以上版本:
  • select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat, DBA_OB_TENANTS 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 < 1000
  • OceanBase V4.0 及以上版本:
  • select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat, DBA_OB_TENANTS 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 < 1000
  • OceanBase V4.0 及以上版本:
  • select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat, DBA_OB_TENANTS 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 < 1000
  • OceanBase V4.0 及以上版本:
  • select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat, DBA_OB_TENANTS 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 < 1000
  • OceanBase V4.0 及以上版本:
  • select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat, DBA_OB_TENANTS 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 < 1000
  • OceanBase V4.0 及以上版本:
  • select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat, DBA_OB_TENANTS 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 < 1000
  • OceanBase V4.0 及以上版本:

select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat, DBA_OB_TENANTS

欢迎访问 OceanBase 官网获取更多信息:https://www.oceanbase.com/

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论