This topic describes monitoring metrics related to the transaction response time details within an OceanBase Database tenant. Transaction response time refers to the time consumed in processing a single transaction within a tenant. To be specific, transaction response time refers to the period from the time when the server receives a transaction request to the time when the response to the request is sent. OceanBase Cloud Platform (OCP) provides the following metrics related to the transaction response time within a tenant based on the commit results: all, trans_commit_rt, and trans_rollback_rt. You can specify a statistical period to query statistics about the transaction response time details in a single zone or on a single OBServer of an OceanBase Database tenant.
all
Definition
The average time consumed in processing all transactions within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| all | transaction_rt | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id="30006",@LABELS}[@INTERVAL])) by (@GBLABELS) / 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, 30006) 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 (30005, 30006) and (con_id > 1000 or con_id = 1) and class < 1000
trans_commit_rt
Definition
The average time consumed in processing committed transactions within a tenant in the specified statistical period.
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 < 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 (30007, 30008) and (con_id > 1000 or con_id = 1) and class < 1000
trans_rollback_rt
Definition
The average time consumed in processing rollback transactions within a tenant in the specified statistical period.
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 < 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 (30009, 30010) and (con_id > 1000 or con_id = 1) and class < 1000