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 | 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 (10000, 10001, 10002, 10003, 10004, 10005, 10006, 140002, 140003, 140005, 140006, 40030, 80040, 80041, 130000, 130001, 130002, 130004, 20000, 20001, 20002, 30000, 30001, 30002, 30005, 30006, 30007, 30008, 30009, 30010, 30011, 30012, 30013, 40000, 40001, 40002, 40003, 40004, 40005, 40006, 40007, 40008, 40009, 40010, 40011, 40012, 40018, 40019, 50000, 50001, 50002, 50004, 50005, 50008, 50009, 50010, 50011, 50037, 50038, 60000, 60001, 60002, 60003, 60004, 60005, 60019, 60020, 60021, 60022, 60023, 60024, 80057, 120000, 120001, 120009, 120008) 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 (10000, 10001, 10002, 10003, 10004, 10005, 10006, 140002, 140003, 140005, 140006, 40030, 80040, 80041, 130000, 130001, 130002, 130004, 20000, 20001, 20002, 30000, 30001, 30002, 30005, 30006, 30007, 30008, 30009, 30010, 30011, 30012, 30013, 40000, 40001, 40002, 40003, 40004, 40005, 40006, 40007, 40008, 40009, 40010, 40011, 40012, 40018, 40019, 50000, 50001, 60087, 50004, 50005, 50008, 50009, 50010, 50011, 50037, 50038, 60000, 60001, 60002, 60003, 60004, 60005, 60019, 60020, 60021, 60022, 60023, 60024, 80057, 120000, 120001, 120009, 120008) 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