DescribeSlowLogRecords
调用DescribeSlowLogRecords接口查看集群慢日志明细。
请求参数
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeSlowLogRecords | 系统规定参数,取值: DescribeSlowLogRecords。 |
DBClusterId | String | 是 | rm-uf6wjk5xxxxxxxxxx | 实例ID。 |
StartTime | String | 是 | 2019-06-01T16:00Z | 查询开始时间。格式:yyyy-MM-ddTHH:mmZ(UTC时间)。 |
EndTime | String | 是 | 2019-06-20T16:00Z | 查询结束时间,需要大于查询开始时间,且与查询开始时间间隔小于7天。 格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 |
DBName | String | 否 | test_db | 数据库名称。 |
PageSize | Integer | 是 | 30 | 每页记录数,取值:
|
PageNumber | Integer | 是 | 1 | 页码,取值:大于0且不超过Integer的最大值。 默认值:1。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
TotalCount | Integer | 100 | 总记录数。 |
PageNumber | Integer | 1 | 页码。 |
PageSize | Integer | 2 | 总页数。 |
Items | - | 慢日志明细列表。 | |
└HostAddress | String | 192.101.2.11 | 连接数据库的客户端地址。 |
└DBName | String | test_database | 数据库名称。 |
└SQLText | String | select count(*) from test where name = ‘8’ | 查询语句。 |
└QueryTime | Long | 12 | 执行时长,单位毫秒。 |
└ParseRowCounts | Long | 24 | 解析行数。 |
└ReturnRowCounts | Long | 123 | 返回行数。 |
└ExecutionStartTime | String | 2019-06-01T16:00Z | 执行开始时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 |
DBClusterId | String | rm-uf6wjk5xxxxxxxxxx | 实例ID。 |
RequestId | String | 1AD222E9-E606-4A42-BF6D-8A4442913CEF | 请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeSlowLogRecords
&DBClusterId=am-uf6wjk5xxxxxxx
&StartTime=2011-06-01T16:00:00Z
&EndTime=2011-06-20T16:00:00Z
&<公共请求参数>
正常返回示例
XML
格式
<DescribeSlowLogRecordsResponse>
<Items>
<SlowLogRecord>
<ReturnRowCounts>0</ReturnRowCounts>
<HostAddress>127.0.0.1:19993</HostAddress>
<SQLText>select count(*) from test</SQLText>
<QueryTime>14</QueryTime>
<ExecutionStartTime>2019-07-24T06:45:30Z</ExecutionStartTime>
<UserName>testuser</UserName>
<ParseRowCounts>20</ParseRowCounts>
<ProcessID>2019072414453017202111115703151073521</ProcessID>
<DBName>testdb</DBName>
</SlowLogRecord>
<SlowLogRecord>
<ReturnRowCounts>0</ReturnRowCounts>
<HostAddress>127.0.0.1:19993</HostAddress>
<SQLText>select count(*) from test where name = '8'</SQLText>
<QueryTime>16</QueryTime>
<ExecutionStartTime>2019-07-24T06:45:29Z</ExecutionStartTime>
<UserName>testuser</UserName>
<ParseRowCounts>2</ParseRowCounts>
<ProcessID>2019072414452917202111115703151073520</ProcessID>
<DBName>testdb</DBName>
</SlowLogRecord>
</Items>
<PageNumber>1</PageNumber>
<TotalCount>46</TotalCount>
<PageSize>30</PageSize>
<RequestId>5C9036FF-2A62-4CB6-8922-E7C881CEF813</RequestId>
<DBClusterId>am-uf6wjk5xxxxxxx</DBClusterId>
</DescribeSlowLogRecordsResponse>
JSON
格式
{
"Items": {
"SlowLogRecord": [
{
"ReturnRowCounts": 0,
"HostAddress": "127.0.0.1:19993",
"SQLText": "select count(*) from test",
"QueryTime": 14,
"ExecutionStartTime": "2019-07-24T06:45:30Z",
"UserName": "testuser",
"ParseRowCounts": 20,
"ProcessID": "2019072414453017202111115703151073521",
"DBName": "testdb"
},
{
"ReturnRowCounts": 0,
"HostAddress": "127.0.0.1:19993",
"SQLText": "select count(*) from test where name = '8'",
"QueryTime": 16,
"ExecutionStartTime": "2019-07-24T06:45:29Z",
"UserName": "testuser",
"ParseRowCounts": 2,
"ProcessID": "2019072414452917202111115703151073520",
"DBName": "testdb"
}
]
},
"PageNumber": 1,
"TotalCount": 46,
"PageSize": 30,
"RequestId": "5C9036FF-2A62-4CB6-8922-E7C881CEF813",
"DBClusterId": "am-uf6wjk5xxxxxxx"
}
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。
评论