This topic describes monitoring metrics related to the transaction response time within an OceanBase Database tenant. Transaction response time refers to the average processing time of each transaction on the server side. 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 Database tenant.
sp transaction
Definition
The response time of local affairs in the specified statistical range.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| local | trans_sp_total_used_time | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id="30080",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="30012",@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 (30012, 30080) 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 (30012, 30080) and (con_id > 1000 or con_id = 1) and class < 1000
distributed
Definition
The response time of distributed affairs in the specified statistical range.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| distributed | trans_distributed_total_used_time | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id="30081",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="30013",@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 (30013, 30081) 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 (30013, 30081) and (con_id > 1000 or con_id = 1) and class < 1000