This topic describes the monitoring metric time consumed by lock waits within an OceanBase Database tenant. You can specify a statistical period to query the time consumed by lock waits in a single zone or on a single OBServer of an OceanBase Database tenant.
Time consumed by lock waits
Definition
The average time consumed in waiting for a write lock in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| - | memstore_write_lock_wait_time | μs |
Calculation expression
sum(rate(ob_sysstat{stat_id="60023",@LABELS}[@INTERVAL])) by (@GBLABELS) / (sum(rate(ob_sysstat{stat_id="60021",@LABELS}[@INTERVAL])) by (@GBLABELS) + sum(rate(ob_sysstat{stat_id="60022",@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 (60021, 60022, 60023) 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 (60021, 60022, 60023) and (con_id > 1000 or con_id = 1) and class < 1000