This topic describes the following performance metrics related to the number of XA transactions in an OceanBase Database tenant: xa_trans_start_count, xa_read_only_trans_total_count, and xa_one_phase_commit_total_count. You can specify a statistical range to query the metrics in a single zone or on a single OBServer node for a tenant.
xa_trans_start_count
Definition
The total number of started XA transactions, including completed ones, in an OceanBase Database tenant.
Description
| Metric | Metric name | Unit |
|---|---|---|
| xa_trans_start_count | xa_trans_start_count | N/A |
Calculation expression
sum(rate(ob_sysstat{stat_id="30220",@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 (30220) 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 (30220) and (con_id > 1000 or con_id = 1) and class < 1000
xa_read_only_trans_total_count
Definition
The total number of read-only XA transactions in an OceanBase Database tenant.
Description
| Metric | Metric name | Unit |
|---|---|---|
| xa_read_only_trans_total_count | xa_read_only_trans_total_count | N/A |
Calculation expression
sum(rate(ob_sysstat{stat_id="30221",@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 (30221) 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 (30221) and (con_id > 1000 or con_id = 1) and class < 1000
xa_one_phase_commit_total_count
Definition
The total number of XA transactions committed in one phase in an OceanBase Database tenant.
Description
| Metric | Metric name | Unit |
|---|---|---|
| xa_one_phase_commit_total_count | xa_one_phase_commit_total_count | N/A |
Calculation expression
sum(rate(ob_sysstat{stat_id="30222",@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 (30222) 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 (30222) and (con_id > 1000 or con_id = 1) and class < 1000