Obtains the monitoring data of a job, including the CPU, GPU, and memory utilization, network, and disk read/write rate. ⚠️ Note: Except for pay-as-you-go tasks based on general-purpose computing resources, all task types are connected to CloudMonitor. Use the CloudMonitor API to call related monitoring. The overwritten features in the original API are no longer maintained. For more information, see \\[Training monitoring and alerting]\\(https://www.alibabacloud.com/help/zh/pai/user-guide/training-monitoring-and-alerting).
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| paidlc:GetJobMetrics | get | *All Resources * |
| none |
Request syntax
GET /api/v1/jobs/{JobId}/metrics HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| JobId | string | Yes | The job ID. You can call ListJobs to query all job IDs. | dlc-20210126170216-******* |
| StartTime | string | No | The beginning of the time range to query monitoring data. The time is displayed in UTC. The default value is the time 1 hour before the current time. | 2020-11-08T16:00:00Z |
| EndTime | string | No | The end time of the time range to query monitoring data. The time is displayed in UTC. The default value is the current time. | 2020-11-09T16:00:00Z |
| TimeStep | string | No | The interval at which monitoring data is returned. Default value: 5. Unit: minutes. | 5m |
| MetricType | string | Yes | The type of the monitoring metrics. Valid values:
| GpuMemoryUsage |
| Token | string | No | The temporary token used for authentication. | eyXXXX-XXXX.XXXXX |
Response parameters
Examples
Sample success responses
JSONformat
{
"JobId": "dlc-20210126170216-*******",
"PodMetrics": [
{
"PodId": "dlc-20210329110128-******-worker-0",
"Metrics": [
{
"Time": 1616987726587,
"Value": 23.45
}
]
}
],
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2021-04-23 | Add Operation | View Change Details |
