This topic describes the PX worker thread usage metric of an OceanBase Database tenant. You can specify a statistical scope to query the PX worker thread usage in a single zone or on a single OBServer node of a tenant.
Definition
The percentage of the number of active sessions that occupy CPU resources and where database commands are executed within the statistical period.
Description
| Metric category | Metric name |
|
|---|---|---|
| px_worker_usage | px_worker_usage | % |
Calculation expression
max(px_target_usage{@LABELS}) by (@GBLABELS)
SQL statements for metric collection
If you use OceanBase Database V4.0.0.0 or later, execute the following statement:
select max(t2.tenant_name) as tenant_name, avg(100 * t1.PEER_TARGET_USED / t1.PEER_TARGET) as usage_percentage from GV$OB_PX_TARGET_MONITOR t1 left join DBA_OB_TENANTS t2 on t1.TENANT_ID = t2.TENANT_ID where t2.TENANT_TYPE <> 'META' group by t1.TENANT_ID;