Description
You can call this operation to query the resource statistics of all OBServer nodes in an OceanBase cluster.
Call description
Prerequisites
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
GET /api/v2/ob/clusters/{id}/serverStats
Request parameters
Path parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | - | The ID of the cluster. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | For more information, see Data structure of ServerResourceStats. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The amount of time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of ServerResourceStats
| Parameter | Type | Description |
|---|---|---|
| ip | String | The IP address of the OBServer node. |
| port | Integer | The port number of the OBServer node. |
| zone | String | The name of the zone. |
| partitionCount | Long | The number of leader partitions. |
| timestamp | Long | The timestamp. |
| unitCount | Long | The number of units. |
| cpuTotal | Number | The total number of CPU cores. |
| cpuAssigned | Number | The allocated number of CPU cores. |
| cpuTotalMin | Double | The actual total number of CPU cores. This parameter takes effect when CPU overprovisioning is enabled. |
| cpuTotalMax | Double | The total number of CPU cores after CPU overprovisioning, which is calculated by using the following formula: Value of cpuTotalMin × Overprovisioning ratio. This parameter takes effect when CPU overprovisioning is enabled. |
| cpuAssignedMin | Double | The sum of the minimum numbers of CPU cores allocated to all tenants. This parameter takes effect when CPU overprovisioning is enabled. |
| cpuAssignedMax | Double | The sum of the maximum numbers of CPU cores allocated to all tenants. This parameter takes effect when CPU overprovisioning is enabled. |
| memoryTotalByte | Long | The total memory size, in bytes. |
| memoryAssignedByte | Long | The allocated memory size, in bytes. |
| logDiskTotalByte | Long | The total size of the log disk, in bytes. |
| logDiskAssignedByte | Long | The allocated size of the log disk, in bytes. |
| logDiskUsedByte | Long | The occupied size of the log disk, in bytes. |
| dataDiskTotalByte | Long | The total size of the data disk, in bytes. |
| dataDiskUsedByte | Long | The occupied size of the data disk, in bytes. |
| systemMemoryByte | Long | The system memory size of the sys500 tenant, in bytes. |
Examples
Sample request
GET /api/v2/ob/clusters/{id}/serverStats
Sample response
{
"data": {
"contents": [{
"cpuAssigned": 5.00,
"cpuAssignedMax": 5.00,
"cpuAssignedMin": 2.50,
"cpuCoreAssigned": 5.00,
"cpuCoreTotal": 20.00,
"cpuTotal": 20.00,
"cpuTotalMax": 20.00,
"cpuTotalMin": 20.00,
"dataDiskTotalByte": 923568963584,
"dataDiskUsedByte": 285212672,
"diskInBytesTotal": 923568963584,
"diskInBytesUsed": 285212672,
"ip": "xxx.xxx.xxx.xxx",
"logDiskAssignedByte": 0,
"logDiskTotalByte": 0,
"logDiskUsedByte": 0,
"memoryAssignedByte": 17179869184,
"memoryInBytesAssigned": 17179869184,
"memoryInBytesTotal": 141395728793,
"memoryTotalByte": 141395728793,
"partitionCount": 1288,
"port": 2882,
"systemMemoryByte": 8589934592,
"unitCount": 1,
"zone": "zone1"
}]
},
"duration": 48,
"server": "74f95ea2f4",
"status": 200,
"successful": true,
"timestamp": "2025-03-20T15:59:46.084+08:00",
"traceId": "3b767051f16231cc"
}