Obtaining the Metrics Supported by Different Model Types
Function
This API is used to obtain the metrics supported by different model types.
Constraints
- Region restrictions: Only the CN-Hong Kong region is supported.
- API rate limiting: The total number of requests for this API from all users cannot exceed 1,000 within one minute.
- User request limit: The number of requests for this API from a single user cannot exceed 200 within one minute.
- Rate-limiting response: When the rate limit is exceeded, the API returns the HTTP status code 429 "Too Many Requests".
- Retry suggestion: If the rate limit is exceeded, wait 60 seconds and try again.
URI
GET /v1/{project_id}/maas/monitoring/generation-supported-metrics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID and Name. Constraints: N/A Range: The value can contain 32 characters. Only lowercase letters and digits are allowed. Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| x-auth-token | Yes | String | Definition: 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. For details, see Authentication. Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| [Array elements] | Array of GenerationMetricsItem objects | Result item corresponding to the model type in GenerationSupportMetricsResponse. |
| Parameter | Type | Description |
|---|---|---|
| type | String | Definition: Model type. Range:
|
| metrics | Array of strings | Definition: Monitoring metrics supported of this model type. Range: N/A |
| desc_zh | String | Definition: Description in Chinese. Range: N/A |
| desc_en | String | Definition: Description in English. Range: N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, which identifies the error type. For details, see MaaS Error Codes. Range: N/A |
| error_msg | String | Definition: Error description. For details, see MaaS Error Codes. Range: N/A |
Request Example
Query the calling statistics metrics supported by each type of model.
/v1/{project_id}/maas/monitoring/generation-supported-metrics Response Example
Status code: 200
Success response
[ {
"type" : "Text Generation",
"metrics" : [ "request_count", "succ_2xx_count", "error_count", "req_count4xx5xx", "error_rate", "total_token", "avg_total_token", "max_total_token", "p50_total_token", "p80_total_token", "p90_total_token", "p99_total_token", "prompt_token", "completion_token", "avg_prompt_token", "p50_prompt_token", "p80_prompt_token", "p90_prompt_token", "p99_prompt_token", "max_prompt_token", "avg_completion_token", "p50_completion_token", "p80_completion_token", "p90_completion_token", "p99_completion_token", "max_completion_token", "avg_latency", "rpm", "tpm", "avg_ttft", "p50_ttft", "p80_ttft", "p90_ttft", "p99_ttft", "max_ttft", "avg_tpot", "p50_tpot", "p80_tpot", "p90_tpot", "p99_tpot", "max_tpot", "cache_token", "cache_hit_ratio" ],
"desc_zh" : "Text generation model",
"desc_en" : "Text generation model"
}] Status code: 400
Failure response
{
"error_msg" : "The project ID in the request does not match that in the token.",
"error_code" : "ModelArts.0210"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success response |
| 400 | Failure response |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot