Querying Service Monitoring Information
Function
This API is used to query service monitoring information. Only the services whose infer_type is real-time or edge can be queried.
URI
GET /v1/{project_id}/services/{service_id}/monitor
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
|
service_id |
Yes |
String |
Service ID |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
node_id |
No |
String |
ID of the node to be queried. This parameter is available only when infer_type is set to edge. By default, all nodes are queried. |
Request Body
None
Response Body
|
Parameter |
Type |
Description |
|---|---|---|
|
service_id |
String |
Service ID |
|
service_name |
String |
Service name |
|
monitors |
monitor array corresponding to infer_type of a service |
Monitoring details |
|
Parameter |
Type |
Description |
|---|---|---|
|
model_id |
String |
Model ID |
|
model_name |
String |
Model name |
|
model_version |
String |
Model version |
|
invocation_times |
Long |
Total number of model instance calls |
|
failed_times |
Long |
Number of failed model instance calls |
|
cpu_core_usage |
Float |
Number of used CPUs |
|
cpu_core_total |
Float |
Total number of CPUs |
|
cpu_memory_usage |
Integer |
Used memory, in MBs |
|
cpu_memory_total |
Integer |
Total memory, in MBs |
|
gpu_usage |
Float |
Number used GPUs |
|
gpu_total |
Float |
Total number of GPUs |
|
Parameter |
Type |
Description |
|---|---|---|
|
node_id |
String |
Node ID |
|
node_name |
String |
Node name |
|
cpu_core_usage |
Float |
Number of used CPUs |
|
cpu_core_total |
Float |
Total number of CPUs |
|
cpu_memory_usage |
Integer |
Used memory, in MBs |
|
cpu_memory_total |
Integer |
Total memory, in MBs |
|
gpu_usage |
Float |
Number used GPUs |
|
gpu_total |
Float |
Total number of GPUs |
Samples
The following shows how to query the monitoring information about a real-time service.
- Sample request
GET https://endpoint/v1/{project_id}/services/{service_id}/monitor
- Sample response
{ "service_id": "xxx", "service_name": "mnist", "monitors": [{ "model_id": "xxxx", "model_name": "minst", "model_version": "1.0.0", "invocation_times": 50, "failed_times": 1, "cpu_core_usage": "2.4", "cpu_core_total": "4", "cpu_memory_usage": "2011", "cpu_memory_total": "8192", "gpu_usage": "0.6", "gpu_total": "1" } ] }
Status Code
For details about the status code, see Table 1.
Last Article: Updating Service Configurations
Next Article: Querying Service Update Logs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.