This topic describes performance metrics related to the number of transactions per second (TPS) in an OceanBase cluster. These metrics are all, trans_commit_count, trans_rollback_count, and trans_timeout_count. You can specify a statistical period to query the TPS statistics in a single zone or on a single OBServer of an OceanBase cluster.
all
Definition
The total number of transactions processed per second in an OceanBase cluster.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| all | transaction_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="30005",@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 (30005) 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 (30005) and (con_id > 1000 or con_id = 1) and class < 1000
trans_commit_count
Definition
The number of transactions committed per second in an OceanBase cluster.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| trans_commit_count | transaction_commit_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="30007",@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 (30007) 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 (30007) and (con_id > 1000 or con_id = 1) and class < 1000
trans_rollback_count
Definition
The number of transactions rolled back per second in an OceanBase cluster.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| trans_rollback_count | transaction_rollback_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="30009",@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 (30009) 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 (30009) and (con_id > 1000 or con_id = 1) and class < 1000
trans_timeout_count
Definition
The number of timed out transactions per second in an OceanBase cluster.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| trans_timeout_count | transaction_timeout_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="30011",@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 (30011) 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 (30011) and (con_id > 1000 or con_id = 1) and class < 1000