QPS

2025-07-25 06:10:58  Updated

This topic describes the performance metrics related to queries per second (QPS) within a tenant. These metrics all, select, insert, update, replace, delete, and other. They are classified based on the SQL statement types. You can specify a statistical period to query the QPS statistics in a single zone or on a single OBServer of an OceanBase Database tenant.

all

Definition

The total number of SQL statement executions per second in an OceanBase Database tenant.

Description

Metric Metric field name Unit
all sql_all_count times/s

Calculation expression

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) + sum(rate(ob_sysstat{stat_id="40018",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • If you use OceanBase Database of a version earlier than V4.0, execute the following statement:

    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
    
  • If you use OceanBase Database V4.0 or later, execute the following statement:

    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

Definition

The number of SELECT statement executions per second in an OceanBase Database tenant.

Description

Metric Metric field name Unit
select sql_select_count times/s

Calculation expression

sum(rate(ob_sysstat{stat_id="40000",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • If you use OceanBase Database of a version earlier than V4.0, execute the following statement:

    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
    
  • If you use OceanBase Database V4.0 or later, execute the following statement:

    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

Definition

The number of INSERT statement executions per second in an OceanBase Database tenant.

Description

Metric Metric field name Unit
insert sql_insert_count times/s

Calculation expression

sum(rate(ob_sysstat{stat_id="40002",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • If you use OceanBase Database of a version earlier than V4.0, execute the following statement:

    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
    
  • If you use OceanBase Database V4.0 or later, execute the following statement:

    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
    

Definition

The number of UPDATE statement executions per second in an OceanBase Database tenant.

Description

Metric Metric field name Unit
update sql_update_count times/s

Calculation expression

sum(rate(sysstat_value{metric_group="sysstat",stat_id="40006",@LABELS}[@INTERVAL]) by (@GBLABELS)) by (@GBLABELS)

SQL statements for metric collection

  • If you use OceanBase Database of a version earlier than V4.0, execute the following statement:

    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
    
  • If you use OceanBase Database V4.0 or later, execute the following statement:

    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
    

Definition

The number of REPLACE statement executions per second in an OceanBase Database tenant.

Description

Metric Metric field name Unit
replace sql_replace_count times/s

Calculation expression

sum(rate(ob_sysstat{stat_id="40004",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • If you use OceanBase Database of a version earlier than V4.0, execute the following statement:

    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
    
  • If you use OceanBase Database V4.0 or later, execute the following statement:

    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
    

Definition

The number of DELETE statement executions per second in an OceanBase cluster.

Description

Metric Metric field name Unit
delete sql_delete_count times/s

Calculation expression

sum(rate(ob_sysstat{stat_id="40008",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • If you use OceanBase Database of a version earlier than V4.0, execute the following statement:

    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
    
  • If you use OceanBase Database V4.0 or later, execute the following statement:

    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
    

Definition

The number of executions of other statements such as data definition language (DDL), data control language (DCL), and data transaction language (DTL) statements per second in an OceanBase cluster.

Description

Metric Metric field name Unit
other sql_other_count times/s

Calculation expression

sum(rate(ob_sysstat{stat_id="40018",@LABELS}[@INTERVAL])) by (@GBLABELS)

SQL statements for metric collection

  • If you use OceanBase Database of a version earlier than V4.0, execute the following statement:

    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
    
  • If you use OceanBase Database V4.0 or later, execute the following statement:

    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
    

Contact Us