This topic describes the performance metric XA Statement Count in OceanBase tenants. The XA Statement Count metric indicates the total number of XA statements in OceanBase tenants. This metric is divided into five submetrics for statistics on the number of XA statements in OceanBase tenants: xa_start_total_count, xa_end_total_count, xa_prepare_total_count, xa_commit_total_count, and xa_rollback_total_count. You can specify the statistics scope to query the XA Statement Count of OceanBase tenants in a single zone or OBServer node.
xa_start_total_count
Description
The number of xa_start statements in OceanBase tenants.
Parameters
| Metrics | Indicator Name | Unit |
|---|---|---|
| xa_start_total_count | xa_start_total_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30200",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement for data collection
OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30200) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30200) and (con_id > 1000 or con_id = 1) and class < 1000
xa_end_total_count
Description
The number of xa_end statements in OceanBase tenants.
Parameters
| Metrics | Indicator Name | Unit |
|---|---|---|
| xa_end_total_count | xa_end_total_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30204",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement for data collection
OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30204) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30204) and (con_id > 1000 or con_id = 1) and class < 1000
xa_prepare_total_count
Description
The number of xa_prepare statements in OceanBase tenants.
Parameters
| Metrics | Indicator Name | Unit |
|---|---|---|
| xa_prepare_total_count | xa_prepare_total_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30208",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement for data collection
OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30208) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30208) and (con_id > 1000 or con_id = 1) and class < 1000
xa_commit_total_count
Description
The number of xa_commit statements in OceanBase tenants.
Parameters
| Metrics | Name | Unit |
|---|---|---|
| xa_commit_total_count | xa_commit_total_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30212",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement for data collection
OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30212) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30212) and (con_id > 1000 or con_id = 1) and class < 1000
xa_rollback_total_count
Description
The number of xa_rollback statements in OceanBase tenants.
Parameters
| Metrics | Name | Unit |
|---|---|---|
| xa_rollback_total_count | xa_rollback_total_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30216",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement for data collection
OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30216) and (con_id > 1000 or con_id = 1) and class < 1000OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30216) and (con_id > 1000 or con_id = 1) and class < 1000