This topic describes monitoring metrics related to the Waiting for event time within an OceanBase Database tenant. These metrics collect statistics on the time consumed by different types of waiting events. These metrics are all, internal_wait, sync_rpc_wait, row_lock_wait, io_wait, latch_wait, and other_wait. You can specify a statistical period to query statistics about the Waiting for event time in a single zone or on a single OBServer of an OceanBase database tenant.
all
Definition
The average time consumed by waiting events within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| all | wait_event_rt | μs |
Calculation expression
sum(rate(ob_waitevent_wait_seconds_total{@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_waitevent_wait_total{@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, sum(total_waits) as total_waits, sum(time_waited_micro) / 1000000 as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_idIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, sum(total_waits) as total_waits, sum(time_waited_micro) / 1000000 as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id
internal_wait
Definition
The average time consumed by internal waiting events within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| internal_wait | system_event_internal_time_waited | μs |
Calculation expression
sum(rate(ob_system_event_time_waited{event_group="INTERNAL",@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, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
sync_rpc_wait
Definition
The average time consumed by waiting events for synchronizing remote procedure calls (RPCs) within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| sync_rpc_wait | system_event_sync_rpc_total_waited | μs |
Calculation expression
sum(rate(ob_system_event_total_waits{event_group="SYNC_RPC",@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, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
row_lock_wait
Definition
The average time consumed by lock waiting events within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| row_lock_wait | system_event_row_lock_wait_total_waited | μs |
Calculation expression
sum(rate(ob_system_event_total_waits{event_group="ROW_LOCK_WAIT",@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, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
io_wait
Definition
The average time consumed by I/O waiting events within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| io_wait | system_event_io_total_waited | μs |
Calculation expression
sum(rate(ob_system_event_total_waits{event_group="IO",@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, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
latch_wait
Definition
The average time consumed by latch waiting events within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| latch_wait | system_event_latch_total_waited | μs |
Calculation expression
sum(rate(ob_system_event_total_waits{event_group="LATCH",@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, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group
other_wait
Definition
The average time consumed by other waiting events within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| other_wait | system_event_other_total_waited | μs |
Calculation expression
sum(rate(ob_system_event_total_waits{event_group="OTHER",@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, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_groupIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, case when event_id = 10000 then 'INTERNAL' when event_id = 13000 then 'SYNC_RPC' when event_id = 14003 then 'ROW_LOCK_WAIT' when (event_id >= 10001 and event_id <= 11006) or (event_id >= 11008 and event_id <= 11011) then 'IO' when event like 'latch:%' then 'LATCH' else 'OTHER' END event_group, sum(total_waits) as total_waits, sum(time_waited_micro / 1000000) as time_waited from v$system_event where v$system_event.wait_class <> 'IDLE' and (con_id > 1000 or con_id = 1) group by tenant_id, event_group