Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lai, Weijian <laiweijian4@huawei.com> Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
14 KiB
Obtaining Service Monitoring
Function
This API is used to obtain service monitoring information.
Debugging
You can debug this API through automatic authentication in or use the SDK sample code generated by API Explorer.
URI
GET /v1/{project_id}/services/{service_id}/monitor
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
service_id |
Yes |
String |
Service ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
node_id |
No |
String |
ID of the edge node to be obtained. This parameter is available only when infer_type is set to edge. By default, all nodes are obtained. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
service_name |
String |
Service name |
service_id |
String |
Service ID |
monitors |
Array of Monitor objects |
Monitoring details |
Parameter |
Type |
Description |
---|---|---|
failed_times |
Integer |
Number of times that a model instance fails to be called. This parameter is available for real-time services. |
model_version |
String |
Model version, which is available for real-time services |
cpu_memory_total |
Integer |
Total memory, in MB |
gpu_usage |
Float |
Number of used GPUs |
node_name |
String |
Node name, which is available for edge services |
gpu_total |
Float |
Total number of GPUs |
model_id |
String |
Model ID, which is available for real-time services |
invocation_times |
Integer |
Number of times that a model instance is called. This parameter is available for real-time services. |
cpu_core_usage |
Float |
Number of used CPU cores |
cpu_core_total |
Float |
Total number of CPU cores |
model_name |
String |
Model name, which is available for real-time services |
cpu_memory_usage |
Integer |
Used memory, in MB |
node_id |
String |
Edge node ID, which is available for edge services |
Example Requests
GET https://{endpoint}/v1/{project_id}/services/{service_id}/monitor
Example Responses
Status code: 200
Monitoring information
{ "service_name" : "mnist", "service_id" : "195c1f2d-136d-40af-a0f3-db5717d2634a", "monitors" : [ { "failed_times" : 1, "model_version" : "1.0.0", "cpu_core_total" : 4, "cpu_memory_total" : 8192, "model_name" : "minst", "gpu_usage" : 0.6, "cpu_memory_usage" : 2011, "gpu_total" : 1, "model_id" : "0e07b41b-173e-42db-8c16-8e1b44cc0d44", "invocation_times" : 50, "cpu_core_usage" : 2.4 } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
Monitoring information |
Error Codes
See Error Codes.