推特 阿里云技术文档正文

DescribeSlowLogRecords_日志管理_API参考_分析型数据库MySQL版

admin 阿里云技术文档 2020-02-11 184 0
阿里云服务器优惠

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 数据库名称。
PageSizeInteger30每页记录数,取值:
  • 30;
  • 50;
  • 100
默认值:30。
PageNumberInteger1页码,取值:大于0且不超过Integer的最大值。

默认值:1。

返回数据

名称类型示例值描述
TotalCountInteger100总记录数。
PageNumberInteger1页码。
PageSizeInteger2总页数。
Items-慢日志明细列表。
└HostAddressString192.101.2.11连接数据库的客户端地址。
└DBNameStringtest_database数据库名称。
└SQLTextStringselect count(*) from test where name = ‘8’查询语句。
└QueryTimeLong12执行时长,单位毫秒。
└ParseRowCountsLong24解析行数。
└ReturnRowCountsLong123返回行数。
└ExecutionStartTimeString2019-06-01T16:00Z执行开始时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。
DBClusterIdStringrm-uf6wjk5xxxxxxxxxx实例ID。
RequestIdString1AD222E9-E606-4A42-BF6D-8A4442913CEF请求ID。

示例

请求示例

  1. http(s)://[Endpoint]/?Action=DescribeSlowLogRecords
  2. &DBClusterId=am-uf6wjk5xxxxxxx
  3. &StartTime=2011-06-01T16:00:00Z
  4. &EndTime=2011-06-20T16:00:00Z
  5. &<公共请求参数>

正常返回示例

XML格式

  1. <DescribeSlowLogRecordsResponse>
  2. <Items>
  3. <SlowLogRecord>
  4. <ReturnRowCounts>0</ReturnRowCounts>
  5. <HostAddress>127.0.0.1:19993</HostAddress>
  6. <SQLText>select count(*) from test</SQLText>
  7. <QueryTime>14</QueryTime>
  8. <ExecutionStartTime>2019-07-24T06:45:30Z</ExecutionStartTime>
  9. <UserName>testuser</UserName>
  10. <ParseRowCounts>20</ParseRowCounts>
  11. <ProcessID>2019072414453017202111115703151073521</ProcessID>
  12. <DBName>testdb</DBName>
  13. </SlowLogRecord>
  14. <SlowLogRecord>
  15. <ReturnRowCounts>0</ReturnRowCounts>
  16. <HostAddress>127.0.0.1:19993</HostAddress>
  17. <SQLText>select count(*) from test where name = '8'</SQLText>
  18. <QueryTime>16</QueryTime>
  19. <ExecutionStartTime>2019-07-24T06:45:29Z</ExecutionStartTime>
  20. <UserName>testuser</UserName>
  21. <ParseRowCounts>2</ParseRowCounts>
  22. <ProcessID>2019072414452917202111115703151073520</ProcessID>
  23. <DBName>testdb</DBName>
  24. </SlowLogRecord>
  25. </Items>
  26. <PageNumber>1</PageNumber>
  27. <TotalCount>46</TotalCount>
  28. <PageSize>30</PageSize>
  29. <RequestId>5C9036FF-2A62-4CB6-8922-E7C881CEF813</RequestId>
  30. <DBClusterId>am-uf6wjk5xxxxxxx</DBClusterId>
  31. </DescribeSlowLogRecordsResponse>

JSON格式

  1. {
  2. "Items": {
  3. "SlowLogRecord": [
  4. {
  5. "ReturnRowCounts": 0,
  6. "HostAddress": "127.0.0.1:19993",
  7. "SQLText": "select count(*) from test",
  8. "QueryTime": 14,
  9. "ExecutionStartTime": "2019-07-24T06:45:30Z",
  10. "UserName": "testuser",
  11. "ParseRowCounts": 20,
  12. "ProcessID": "2019072414453017202111115703151073521",
  13. "DBName": "testdb"
  14. },
  15. {
  16. "ReturnRowCounts": 0,
  17. "HostAddress": "127.0.0.1:19993",
  18. "SQLText": "select count(*) from test where name = '8'",
  19. "QueryTime": 16,
  20. "ExecutionStartTime": "2019-07-24T06:45:29Z",
  21. "UserName": "testuser",
  22. "ParseRowCounts": 2,
  23. "ProcessID": "2019072414452917202111115703151073520",
  24. "DBName": "testdb"
  25. }
  26. ]
  27. },
  28. "PageNumber": 1,
  29. "TotalCount": 46,
  30. "PageSize": 30,
  31. "RequestId": "5C9036FF-2A62-4CB6-8922-E7C881CEF813",
  32. "DBClusterId": "am-uf6wjk5xxxxxxx"
  33. }
版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。

评论

-----