This topic describes performance metrics related to the transaction response time in an OceanBase cluster. These metrics are all, trans_commit_rt, and trans_rollback_rt. They collect statistics on the average time consumed in processing, committing, and rolling back a transaction in an OceanBase cluster. You can specify a statistical period to query statistics about the transaction response time in a single zone or on a single OBServer of an OceanBase cluster.
all
Definition
The average time for processing a transaction in an OceanBase cluster.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| all | tps_rt | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id="30006",@LABELS}[@INTERVAL])) by (@GBLABELS) / (sum(rate(ob_sysstat{stat_id="30009",@LABELS}[@INTERVAL])) by (@GBLABELS) + 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 (30006, 30007, 30009) and (con_id > 1000 or con_id = 1) and class < 1000If 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 (30006, 30007, 30009) and (con_id > 1000 or con_id = 1) and class < 1000
trans_commit_rt
Definition
The average time for committing a transaction in an OceanBase cluster.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| trans_commit_rt | transaction_commit_rt | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id="30008",@LABELS}[@INTERVAL])) by (@GBLABELS) / 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, 30008) 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, 30008) and (con_id > 1000 or con_id = 1) and class < 1000
trans_rollback_rt
Definition
The average time for rolling back a transaction in an OceanBase cluster.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| trans_rollback_rt | transaction_rollback_rt | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id="30010",@LABELS}[@INTERVAL])) by (@GBLABELS) / 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, 30010) 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, 30010) and (con_id > 1000 or con_id = 1) and class < 1000