查询processlist快照数据
更新时间:2023-09-26
接口说明
查询processlist快照数据。
请求URI
Plain Text
1GET /v{version}/instance/{instanceId}/performance/processlist
2HOST: rds.bj.baidubce.com
3Content-Type: application/json
4Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 示例值 | 描述 |
---|---|---|---|---|---|
version | Integer | 是 | URL参数 | 1 | API版本号 |
instanceId | String | 是 | URL参数 | rds-uXaqeGet | 实例ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
datetime | String | API版本号。此接口值为1 |
processList | List<Processlist> | processList 对象 |
Processlist
参数名称 | 类型 | 描述 |
---|---|---|
sql | String | sql语句 |
info | String | INFO字段 |
db | String | 数据库名 |
state | String | 状态字符说明 |
host | String | 主机 |
command | String | 命令 |
user | String | 用户 |
time | Integer | 执行时间 |
id | Long | 快照数据 ID |
lockHold | Map<String, List |
key:持有锁的ID,也就是trx。 value:锁住的process list 里面的ID 也就是MySQL thread ID |
lockWait | List<ProcessListResponse.Process.LockWait> | 等待锁的对象 |
ProcessListResponse.Process.LockWait
参数名称 | 类型 | 描述 |
---|---|---|
lockId | String | 锁ID |
id | Integer | MySQL thread ID |
请求示例
Plain Text
1GET /v1/instance/rds-uXaqeGet/performance/processlist
2HOST: rds.bj.baidubce.com
3Content-Type: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2023-08-08T03:28:11Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4{
5 "datetime": "2021-08-23 17:54:49",
6 "processList": [
7 {
8 "sql": "select * from test", //原INFO字段
9 "db": "test",
10 "state": "Waiting on empty queue",
11 "host": "localhost",
12 "command": "Daemon",
13 "user": "event_scheduler",
14 "time": 3635,
15 "id": 1,
16 "lockHold": { // 锁持有
17 "12757825:43:10:2": [ // 持有锁的ID,也就是trx 里面的request lock ID
18 20151179 // 锁住的process list 里面的ID 也就是MySQL thread ID
19 ]
20 },
21 "lockWait": [
22 {
23 "lockId": "12757825:43:10:2",
24 "id": 20151178
25 }
26 ]
27 }
28 ]
29}