This topic describes the monitoring metric Tenant CPU cost within an OceanBase Database tenant. You can specify a statistical period to query the Tenant CPU cost in a single zone or on a single OBServer of an OceanBase Database tenant.
Definition
The CPU utilization of an OceanBase Database tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| Tenant CPU cost | ob_tenant_cpu_percent | % |
Calculation expression
sum(rate(ob_sysstat{stat_id="140013",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(ob_sysstat{stat_id="140005",@LABELS}) by (@GBLABELS) / 100
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 (140013, 140005) and (con_id > 1000 or con_id = 1)If 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 (140013, 140005) and (con_id > 1000 or con_id = 1)