This topic describes the frontend workload metrics of OceanBase Database tenants. The frontend workload metrics are divided into 12 metrics: on_cpu (number of active sessions executing database commands that occupy CPU resources), application (number of active sessions experiencing wait events of the APPLICATION type), configuration (number of active sessions experiencing wait events of the CONFIGURATION type), administrative (number of active sessions experiencing wait events of the ADMINISTRATIVE type), concurrency (number of active sessions experiencing wait events of the CONCURRENCY type), commit (number of active sessions experiencing wait events of the COMMIT type), idle (number of active sessions experiencing wait events of the IDLE type), network (number of active sessions experiencing wait events of the NETWORK type), user_io (number of active sessions experiencing wait events of the USER_IO type), system_io (number of active sessions experiencing wait events of the SYSTEM_IO type), cluster (number of active sessions experiencing wait events of the CLUSTER type), and other (number of active sessions experiencing wait events of the OTHER type). You can specify the statistics scope to query the frontend workload data of a tenant on a single zone or OBServer node.
Note
For more information about the types of wait events, see Wait events.
on_cpu
Description
The number of active sessions that execute database commands and occupy the CPU within the specified time range.
Parameters
| Metrics | Metric Name | Unit |
|---|---|---|
| on_cpu | ob_foreground_on_cpu_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="ON_CPU",@LABELS}) by (@GBLABELS)
SQL statement for data collection
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
application
Description
The number of active sessions that are in the APPLICATION wait event type within the specified time range.
Parameters
| Metrics | Metric Name | Unit |
|---|---|---|
| application | ob_foreground_application_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="APPLICATION",@LABELS}) by (@GBLABELS)
SQL statement for data collection
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
configuration
Description
The number of active sessions that are in the CONFIGURATION wait event type within the specified time range.
Parameters
| Metrics | Metric Name | Unit |
|---|---|---|
| configuration | ob_foreground_configuration_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="CONFIGURATION",@LABELS}) by (@GBLABELS)
SQL statement for data collection
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
administrative
Description
The number of active sessions that are experiencing wait events of the ADMINISTRATIVE type within the specified scope.
Parameters
| Metrics | Indicator Name | Unit |
|---|---|---|
| administrative | ob_foreground_administrative_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="ADMINISTRATIVE",@LABELS}) by (@GBLABELS)
SQL query
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
concurrency
Description
The number of active sessions that are experiencing wait events of the CONCURRENCY type within the specified scope.
Parameters
| Metrics | Indicator Name | Unit |
|---|---|---|
| concurrency | ob_foreground_concurrency_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="CONCURRENCY",@LABELS}) by (@GBLABELS)
SQL query
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
commit
Description
The number of active sessions that are experiencing wait events of the COMMIT type within the specified scope.
Parameters
| Metrics | Indicator Name | Unit |
|---|---|---|
| commit | ob_foreground_commit_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="COMMIT",@LABELS}) by (@GBLABELS)
SQL query
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
network
Description
The number of active sessions in the NETWORK wait class within the specified scope.
Parameters
| Metrics | Name | Unit |
|---|---|---|
| network | ob_foreground_network_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="NETWORK",@LABELS}) by (@GBLABELS)
SQL query
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
user_io
Description
The number of active sessions in the USER_IO wait class within the specified scope.
Parameters
| Metrics | Name | Unit |
|---|---|---|
| user_io | ob_foreground_user_io_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="USER_IO",@LABELS}) by (@GBLABELS)
SQL query
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
system_io
Description
The number of active sessions in the SYSTEM_IO wait class within the specified scope.
Parameters
| Metrics | Name | Unit |
|---|---|---|
| system_io | ob_foreground_system_io_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="SYSTEM_IO",@LABELS}) by (@GBLABELS)
SQL query
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
cluster
Description
The number of active sessions that are experiencing wait events of the CLUSTER type within the specified scope.
Parameter description
| Metrics | Indicator Name | Unit |
|---|---|---|
| cluster | ob_foreground_cluster_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="CLUSTER",@LABELS}) by (@GBLABELS)
SQL statement for data collection
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id
other
Description
The number of active sessions that are experiencing wait events of the OTHER type within the specified scope.
Parameter description
| Metrics | Indicator Name | Unit |
|---|---|---|
| other | ob_foreground_other_waitevent_cnt | - |
Expression
sum(ob_foreground_waitevent_cnt{wait_class="OTHER",@LABELS}) by (@GBLABELS)
SQL statement for data collection
For OceanBase Database V4.2.0.0 and later, and earlier than V4.3.0.0:
SELECT /*+ MONITOR_AGENT */ ash.tenant_id tenant_id, if (ash.event_no is null or ash.event_no = 0, 'ON_CPU', wait_class) wait_class, count(*) as cnt FROM oceanbase.__all_virtual_ash ash LEFT JOIN oceanbase.v$event_name name on ash.event_no = name.`event#` WHERE sample_time between now() - INTERVAL 1 SECOND and now() and (wait_class <> 'IDLE' or wait_class is null) and session_type = 0 group by wait_class, tenant_id