This topic describes the following frontend workload metrics for OceanBase Database tenants: on_cpu, application, configuration, administrative, concurrency, commit, idle, network, user_io, system_io, cluster, and other. You can specify a statistical period to query the frontend workload metrics of a tenant in a single zone or on a single OBServer node.
Note
For more information about the classes of wait events, see Wait events.
on_cpu
Definition
The number of active sessions that occupy CPU resources and where database commands are executed within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| on_cpu | ob_foreground_on_cpu_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“ON_CPU”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the APPLICATION class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| application | ob_foreground_application_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“APPLICATION”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the CONFIGURATION class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| configuration | ob_foreground_configuration_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“CONFIGURATION”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the ADMINISTRATIVE class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| administrative | ob_foreground_administrative_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“ADMINISTRATIVE”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the CONCURRENCY class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| concurrency | ob_foreground_concurrency_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“CONCURRENCY”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the COMMIT class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| commit | ob_foreground_commit_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“COMMIT”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the NETWORK class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| network | ob_foreground_network_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“NETWORK”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the USER_IO class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| user_io | ob_foreground_user_io_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“USER_IO”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the SYSTEM_IO class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| system_io | ob_foreground_system_io_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“SYSTEM_IO”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the CLUSTER class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| cluster | ob_foreground_cluster_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“CLUSTER”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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
Definition
The number of active sessions that are waiting for events of the OTHER class within the statistical period.
Description
| Metric | Metric name | Unit |
|---|---|---|
| other | ob_foreground_other_waitevent_cnt | N/A |
Calculation expression
sum(ob_foreground_waitevent_cnt{wait_class=“OTHER”,@LABELS}) by (@GBLABELS)
SQL statements for metric collection
OceanBase Database V4.2.0.0 and later but 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