调用DescribeSlowLogRecords接口查看集群慢日志明细。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 否 | DescribeSlowLogRecords |
系统规定参数,取值:DescribeSlowLogRecords。 |
DBClusterId | String | 是 | rm-uf6wjk5xxxxxxxxxx |
实例ID。 |
EndTime | String | 是 | 2019-06-20T16:05:00Z |
查询结束时间,需要大于查询开始时间,且与查询开始时间间隔小于7天。 格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 |
StartTime | String | 是 | 2019-06-01T16:05:00Z |
查询开始时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 |
DBName | String | 否 | test_db |
数据库名称。 |
PageSize | Integer | 否 | 30 |
每页记录数,取值:
默认值:30。 |
PageNumber | Integer | 否 | 1 |
页码,取值:大于0且不超过Integer的最大值。 默认值:1。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
DBClusterId | String | rm-uf6wjk5xxxxxxxxxx |
实例ID。 |
Items | Array of SlowLogRecord |
慢日志明细列表。 |
|
SlowLogRecord | |||
DBName | String | test_database |
数据库名称。 |
ExecutionStartTime | String | 2019-06-01T16:00Z |
执行开始时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 |
HostAddress | String | 192.101.2.11 |
连接数据库的客户端地址。 |
ParseRowCounts | Long | 24 |
解析行数。 |
PeakMemoryUsage | String | 3.059 |
查询的峰值内存,单位KB。 |
ProcessID | String | 2019072414452917202111115703151073520 |
进程ID。 |
QueryTime | Long | 12 |
执行时长,单位ms。 |
QueueTime | Long | 34 |
查询执行前的排队时间,单位ms。 |
ReturnRowCounts | Long | 123 |
返回行数。 |
SQLText | String | select count(*) from test where name = ‘8’ |
查询语句。 |
ScanSize | String | 0.703 |
存储扫描的数据量,单位KB。 |
State | String | SUCCESSED |
查询状态。 |
UserName | String | testuser |
用户名。 |
PageNumber | String | 1 |
页码。 |
PageSize | String | 2 |
总页数。 |
RequestId | String | 1AD222E9-E606-4A42-BF6D-8A4442913CEF |
请求ID。 |
TotalCount | String | 100 |
总记录数。 |
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeSlowLogRecords
&DBClusterId=rm-uf6wjk5xxxxxxxxxx
&EndTime=2019-06-20T16:05:00Z
&StartTime=2019-06-01T16:05:00Z
&<公共请求参数>
正常返回示例
XML
格式
<TotalCount>100</TotalCount>
<RequestId>1AD222E9-E606-4A42-BF6D-8A4442913CEF</RequestId>
<PageSize>2</PageSize>
<PageNumber>1</PageNumber>
<DBClusterId>rm-uf6wjk5xxxxxxxxxx</DBClusterId>
<Items>
<SlowLogRecord>
<UserName>testuser</UserName>
<PeakMemoryUsage>3.059</PeakMemoryUsage>
<ExecutionStartTime>2019-06-01T16:00Z</ExecutionStartTime>
<QueryTime>12</QueryTime>
<ParseRowCounts>24</ParseRowCounts>
<HostAddress>192.101.2.11</HostAddress>
<SQLText>select count(*) from test where name = ‘8’</SQLText>
<State>SUCCESSED</State>
<ReturnRowCounts>123</ReturnRowCounts>
<DBName>test_database</DBName>
<QueueTime>34</QueueTime>
<ProcessID>2019072414452917202111115703151073520</ProcessID>
<ScanSize>0.703</ScanSize>
</SlowLogRecord>
</Items>
JSON
格式
{
"TotalCount": 100,
"RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
"PageSize": 2,
"PageNumber": 1,
"DBClusterId": "rm-uf6wjk5xxxxxxxxxx",
"Items": {
"SlowLogRecord": {
"UserName": "testuser",
"PeakMemoryUsage": 3.059,
"ExecutionStartTime": "2019-06-01T16:00Z",
"QueryTime": 12,
"ParseRowCounts": 24,
"HostAddress": "192.101.2.11",
"SQLText": "select count(*) from test where name = ‘8’",
"State": "SUCCESSED",
"ReturnRowCounts": 123,
"DBName": "test_database",
"QueueTime": 34,
"ProcessID": 2.0190724144529173e+36,
"ScanSize": 0.703
}
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | 您指定的 DBClusterId 不存在,请确认 DBClusterId 值是否正确。 |
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交