This topic describes the Tenant thread usage metric of an OceanBase Database tenant. You can specify a statistical scope to query the thread usage in a single zone or on a single OBServer node of a tenant.
Definition
The percentage of the number of active threads in a tenant to the maximum number of threads for the tenant.
Description
| Metric | Metric name | Unit |
|---|---|---|
| Tenant thread usage | ob_tenant_thread_percent | % |
Calculation expression
100 * sum(ob_sysstat{stat_id="140006",@LABELS}) by (@GBLABELS) / sum(ob_sysstat{stat_id="140005",@LABELS}) 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 (140005, 140006) 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 (140005, 140006) and (con_id > 1000 or con_id = 1) and class < 1000