You can call the DescribeDBProxyPerformance operation to query the performance metrics of the database proxy for an ApsaraDB RDS instance.
Before you call the DescribeDBProxyPerformance operation, make sure that the ModifyDBProxy operation is called to enable the database proxy feature for the instance.
- The dedicated proxy feature of ApsaraDB RDS for MySQL provides capabilities such as read/write splitting and short-lived connection optimization. For more information, see What are database proxies?
- The database proxy feature of ApsaraDB RDS for PostgreSQL supports read/write splitting. For more information, see What are database proxies?
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | DescribeDBProxyPerformance |
The operation that you want to perform. Set the value to DescribeDBProxyPerformance. |
| DBInstanceId | String | Yes | rm-t4n3axxxxx |
The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance. |
| DBProxyInstanceType | String | No | DedicatedProxy |
The type of proxy that is enabled on the instance. Set the value to DedicatedProxy. |
| StartTime | String | Yes | 2019-09-19T01:00:00Z |
The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. |
| EndTime | String | Yes | 2019-09-21T18:00:00Z |
The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. |
| RegionId | String | Yes | cn-hangzhou |
The ID of the region where the instance resides. You can call the DescribeRegions operation to query the most recent region list. |
| MetricsName | String | Yes | Maxscale_CpuUsage |
The performance metrics that you want to query. If the instance runs MySQL, you can query only the Maxscale_CpuUsage performance metric, which indicates the CPU utilization of the instance. If the instance runs PostgreSQL, you can query the following performance metrics:
If you want to query more than one performance metric, separate the performance metrics with commas (,). You can specify up to six performance metrics in a single request. |
| DBProxyEngineType | String | No | normal |
An internal parameter. You do not need to specify this parameter. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| EndTime | String | 2019-09-21T18:00:00Z |
The end of the time range that is queried. |
| StartTime | String | 2019-09-19T01:00:00Z |
The beginning of the time range that is queried. |
| DBInstanceId | String | lsmexxxxxxx |
The ID of the instance. |
| RequestId | String | DD31056F-A0CE-41D7-AD39-689B6ABAE982 |
The ID of the request. |
| DBProxyEngineType | String | normal |
An internal parameter. You do not need to specify this parameter. |
| PerformanceKeys | Array of PerformanceKey |
An array that consists of the performance metrics that are returned. |
|
| PerformanceKey | |||
| ValueFormat | String | docker_container_cpu |
The format in which the value of the performance metric is returned. |
| Key | String | cpu_ratio |
The name of the performance metric. |
| Values | Array of PerformanceValue |
An array that consists of the values of the performance metric in the following format: {value1, value2, ...}. |
|
| PerformanceValue | |||
| Date | String | 2019-10-10T09:00:00Z |
The time when the value of the performance metric was recorded. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. |
| Value | String | 2.83 |
The value of the performance metric. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=DescribeDBProxyPerformance
&RegionId=cn-hangzhou
&DBInstanceId=rm-t4n3axxxxx
&MetricsName=Maxscale_CpuUsage
&StartTime=2019-09-19T01:00:00Z
&EndTime=2019-09-21T18:00:00Z
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeDBProxyPerformanceResponse>
<DBInstanceId>lsmexxxxxxx</DBInstanceId>
<RequestId>DD31056F-A0CE-41D7-AD39-689B6ABAE982</RequestId>
<PerformanceKeys>
<PerformanceKey>
<Values>
<PerformanceValue>
<Value>2.83</Value>
<Date>2019-10-10T09:00:00Z</Date>
</PerformanceValue>
</Values>
<Key>cpu_ratio</Key>
<ValueFormat>docker_container_cpu</ValueFormat>
</PerformanceKey>
</PerformanceKeys>
<EndTime>2019-10-10T09:39:28Z</EndTime>
<StartTime>2019-10-01T09:39:28Z</StartTime>
</DescribeDBProxyPerformanceResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"DBInstanceId" : "lsmexxxxxxx",
"RequestId" : "DD31056F-A0CE-41D7-AD39-689B6ABAE982",
"PerformanceKeys" : {
"PerformanceKey" : [ {
"Values" : {
"PerformanceValue" : [ {
"Value" : "2.83",
"Date" : "2019-10-10T09:00:00Z"
} ]
},
"Key" : "cpu_ratio",
"ValueFormat" : "docker_container_cpu"
} ]
},
"EndTime" : "2019-10-10T09:39:28Z",
"StartTime" : "2019-10-01T09:39:28Z"
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidDBInstanceName.NotFound | The specified DB instance name does not exist. | The error message returned because the name of the instance cannot be found. |
| 400 | InvalidDBInstanceName | Specified parameter DBInstanceName is not valid. | The error message returned because the value of the DBInstanceName parameter is invalid. Check whether the value is null or an empty string. |
| 404 | Endpoint.NotFound | Specified endpoint is not found. | The error message returned because the port number that you specified cannot be found. |
For a list of error codes, visit the API Error Center.