数据库工作台
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
DB | String | test | 数据库名称。 |
ExecuteCount | Integer | 2 | 执行次数。 |
ExecuteCountRatio | Integer | 66.67 | 执行总次数占比。 |
FirstAppearTime | Integer | 1702613263 | 第一次出现的时间,使用秒时间戳格式。 |
LastAppearTime | Integer | 1702613273 | 最后一次出现的时间,使用秒时间戳格式。 |
LockTimeRatio | Integer | 0 | 锁总耗时占比。 |
LockTimeStats | LockTimeStatsObject | { "Average": 0, "Max": 0, "Min": 0, "Total": 0 } | 锁耗时的统计结果,以秒为单位。 |
PTAnalysisResult | String | \n# Attribute pct total min max avg\n#******* | 仿 PT 解析工具输出结果的文本字符串。 |
QueryTimeRatio | Integer | 77.78 | 查询总耗时占比。 |
QueryTimeStats | QueryTimeStatsObject | { "Average": 3.5001745, "Max": 4.00016, "Min": 3.000189, "Total": 7.000349 } | 锁耗时的统计结果,以秒为单位。 |
RowsExaminedRatio | Integer | 0 | 扫描总行数占比。 |
RowsExaminedStats | RowsExaminedStatsObject | { "Average": 0, "Max": 0, "Min": 0, "Total": 0 } | 扫描行数的统计结果。 |
RowsSentRatio | Integer | 66.67 | 返回总行数占比。 |
RowsSentStats | RowsSentStatsObject | { "Average": 1, "Max": 1, "Min": 1, "Total": 2 } | 返回行数的统计结果。 |
SQLTemplate | String | select sleep(?) | SQL 模板。 |
SQLTemplateID | String | eb4a2b85844fd80206871a75c065411778729031ded219d92281062e8473******* | 慢 SQL 模版的哈希值。 |
SourceIP | String | 172.23.***.*** | IP 地址。 |
User | String | test_user | 执行者名称。 |
Table | String | testtable | 表名。 |
SqlMethod | String | SELECT | SQL 类型。 |
SqlFingerprint | String | 8c6976e5b5410415bde908bd4dee15df | SQL 指纹。 |
RowsAffectedRatio | Double | 0 | 影响行数占比。 |
RowsAffectedStats | Object of StatisticResult | { "max": 1250.0, "min": 1.0, "total": 28650.0, "average": 114.6 } | 影响行数的统计结果。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
SqlFingerprint | String | a1b2c3d4 | SQL 指纹。 |
SqlTemplate | String | select * from orders where id = ? | SQL 模板。 |
InstanceID | String | mysql-76eda4****** | 实例 ID。 |
TenantID | String | 2105****** | 租户 ID。 |
DBName | String | order_db | 数据库名。 |
ExecTime | Integer | 12.5 | 平均执行耗时。 |
CpuTime | Integer | 3.2 | 平均 CPU 耗时。 |
RowsExamined | Integer | 1000 | 平均扫描行数。 |
RowsAffected | Integer | 10 | 平均影响行数。 |
RowsSent | Integer | 20 | 平均返回行数。 |
TotalExecTime | Integer | 1250 | 总执行耗时。 |
Count | Integer | 100 | 执行次数。 |
SqlTable | String | orders | 表名。 |
SqlType | String | SELECT | SQL 类型。取值包括:SELECT、INSERT、UPDATE、DELETE、ALTER、CREATE、DROP、RENAME、TRUNCATE、OTHER。 |
IsCollectSqlFingerprint | Boolean | TRUE | 是否采集 SQL 指纹。取值如下:
|
ServerPort | String | 3306 | 服务端口。 |
BytesSent | Integer | 1024 | 发送字节数。 |
CclWaitTime | Integer | 0 | SQL 限流等待耗时。 |
GroupFollowerWaitTime | Integer | 0 | 复制从节点的等待时间。 |
InnodbIoReadBytes | Integer | 4096 | InnoDB IO 读取字节数。 |
InnodbIoReads | Integer | 10 | InnoDB IO 读取页面数。 |
InnodbPageAccess | Integer | 150 | InnoDB 逻辑页读取次数。 |
LatchWaitTime | Integer | 0 | Latch 等待耗时。 |
MdlWaitTime | Integer | 0 | MDL 锁等待耗时。 |
RedoLogFlushTime | Integer | 2 | Redo Log 刷盘耗时。 |
RowlockWaitTime | Integer | 0 | 行锁等待耗时。 |
SemiSyncWaitTime | Integer | 0 | 半同步复制等待耗时。 |
SocketSendTime | Integer | 1 | Socket 发送耗时。 |
TablelockWaitTime | Integer | 0 | 表锁等待耗时。 |
TcCommitTime | Integer | 3 | 事务提交耗时。 |
TcFlushTime | Integer | 1 | 事务日志刷盘耗时。 |
ThreadSchedTime | Integer | 5 | 线程调度等待耗时。 |
ThreadWaitTime | Integer | 0 | 线程等待耗时。 |
TmpDiskTables | Integer | 0 | 磁盘临时表数量。 |
TotalCpuTime | Integer | 50 | CPU 总耗时。 |
TrxCommitTime | Integer | 3 | 事务提交耗时。 |
WaitLockTime | Integer | 0 | 锁等待总耗时。 |
名称 | 类型 | 是否必选 | 示例值 | 描述 |
名称 | 类型 | 是否必选 | 示例值 | 描述 |
EventId | String | 否 | 2092137580354129920 | 事件 ID。 |
Action | String | 否 | Expand | 扩缩容配置,取值如下:
|
StartTime | Integer | 否 | 1661222493 | 事件开始时间。 |
EndTime | Integer | 否 | 1661222493 | 事件结束时间。 |
EventStatus | String | 否 | EventScaling | 事件状态。取值如下:
|
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
Action | String | Expand | 扩缩容配置,取值如下:
|
After | String | 0G | 扩缩容后通用展示值。 |
AfterAutoScale | Integer | 0 | 扩缩容后值。 |
AutoScaleMetricName | String | Disk | 扩缩容指标。当前仅支持对磁盘进行扩容,即该参数取值为 Disk。 |
Before | String | 300G | 扩缩容前通用展示值。 |
BeforeAutoScale | Integer | 10 | 扩缩容前值。 |
EndTime | String | 2026-08-24T21:21:43Z | 结束时间。 |
EventId | String | 2091984066520817664 | 事件 ID。 |
EventStatus | String | EventScaling | 事件状态。取值如下:
|
Memo | String | 测试 | 备注。 |
MetricUnit | String | % | 指标单位。 |
RuleId | String | 2031045967368716288 | 规则 ID。 |
RuleType | String | Auto | 规则类型。取值如下:
|
StartTime | String | 2026-08-24T20:20:43Z | 开始时间。 |
TriggerCondition | [ { "ComparisonOperator": "\u003e", "MetricName": "磁盘使用率", "Threshold": "90.00%", "TimeInfo": "" } ] | 触发条件列表。 | |
TriggerInfo | String | 资源不足,扩容失败。 | 报错信息。 |
TriggerValue | String | 80% | 触发值。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
ApprovalUsers | Object[] | { "UserId": "", "UserName": "" } | 节点审批人信息,包括用户 ID 和用户名。 |
CreateUser | String[] | { "UserId": "", "UserName": "" } | 节点创建人信息,包括用户 ID 和用户名。 |
Memo | String | 审批节点的备注信息。 | DBA |
NodeId | String | 审批节点 ID。 | 0 |
NodeName | String | 审批节点名称。 | DBA |
NodeType | String | 审批节点类型。返回值如下。
| System |
参数 | 类型 | 示例值 | 描述 |
参数 | 类型 | 示例值 | 描述 |
Db | String | tpch | 数据库名称。 |
Date | String | 20250427 | 诊断日期。使用 UTC + 8 时区,例如:20250427。 |
Status | String | SUCCESS | 诊断任务状态。包括:
|
AdviceNum | Integer | 0 | 待优化的 SQL 数量。 说明 索引建议 SQL 数量与待改写 SQL 数量,去重后的总数量,即待优化的 SQL 数量。 |
SummaryId | String | 9853ae90-4052-4953-b117-b1f59035**** | 每次诊断的唯一标识。 |
SlowQueryNum | Integer | 0 | 总诊断慢 SQL 数量。 |
AdviceIndexNum | Integer | 0 | 索引建议 SQL 数量。 |
NoAdviceSQLNum | Integer | 142 | 无建议 SQL 数量。 |
AdviceRewriteNum | Integer | 0 | 待改写 SQL 数量。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
Advice | String | 建议用户结合业务逻辑对 SQL 进行优化调整 | 按建议聚合的诊断建议。
|
advices | Array of Object | 按模块聚合的诊断建议。如果请求参数中聚合类型是 Module,返回参数是 Advices。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
DB | String | tpch | 数据库名。 |
agg | Object | 聚合信息。 | |
Risk | String | 无 | 风险。 |
User | Array of String | sqlbrain | 用户名。 |
Advice | String | 建议用户结合业务逻辑对 SQL 进行优化调整 | 诊断建议。
|
Benefit | Double | 0 | 优化后预估总耗时收益。 |
SpeedUp | Double | 1 | 优化后预估性能提升倍数。 |
SQLModule | String | SELECT nation,o_year,SUM(amount) AS sum_profit FROM (SELECT n_name AS nation,EXTRACT(YEAR FROM o_orderdate) AS o_year,l_extendedprice(?-l_discount)-ps_supplycostl_quantity AS amount FROM ((((((part) JOIN supplier) JOIN lineitem) JOIN partsupp) JOIN orders) JOIN nation) WHERE s_suppkey=l_suppkey AND ps_suppkey=l_suppkey AND ps_partkey=l_partkey AND p_partkey=l_partkey AND o_orderkey=l_orderkey AND s_nationkey=n_nationkey AND p_name LIKE ?) AS profit GROUP BY nation,o_year ORDER BY nation,o_year DESC | SQL 模板。 |
SourceIPs | Array of String | 100.65.**.** | 客户端地址。 |
TableName | String | L | 表名。 |
AdviceLevel | String | Low | 优化推荐程度。 |
AdviceIndexSize | Double | 0 | 推荐索引大小预估。 |
QueryTimeAvgAfter | Double | 33.352660417661085 | 优化后查询时间预估。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
DB | String | tpch | 数据库名。 |
PSM | String | - | 内场 PSM。 |
User | String | sqlbrain | 用户名。 |
Table | String | lineitem,nation,orders,part,partsupp,supplier | 表名。 |
SourceIP | String | 100.65.**.** | 客户端地址。 |
SqlMethod | String | SELECT | SQL 类型。 |
SQLTemplate | String | 55c9cb442b6418e35b79ac8797ecde33b664768318f2ed997c13bfe8c5e**** | 慢 SQL 模板。 |
ExecuteCount | Integer | 419 | 执行次数。 |
LockTimeRatio | Double | 0.03 | 锁总耗时占比。 |
LockTimeStats | Object | { "Max": 0.000013, "Min": 0.000002, "Total": 0.0017869999999999997, "Average": 0.000004264916467780429 } | 锁耗时的统计结果,以秒为单位。 |
RowsSentRatio | Double | 0.04 | 返回总行数占比。 |
RowsSentStats | Object | { "Max": 175, "Min": 175, "Total": 73325, "Average": 175 } | 返回行数的统计结果。 |
SQLTemplateID | String | 55c9cb442b6418e35b79ac8797ecde33b664768318f2ed997c13bfe8c5e**** | 慢 SQL 模板哈希值。 |
LastAppearTime | Integer | 1750982260 | 最后一次出现的时间。 |
QueryTimeRatio | Double | 15.12 | 查询总耗时占比。 |
QueryTimeStats | Object | { "Max": 37.44366, "Min": 30.146108, "Total": 461.0285326293491, "Average": 13974.764714999996 } | 查询耗时的统计结果,以秒为单位。 |
SqlFingerprint | String | -- | SQL 指纹。 |
FirstAppearTime | Integer | 1750809748 | 第一次出现的时间。 |
PTAnalysisResult | String | # Attribute pct total min max avg # ============= === ======= ======= ======= ======= # Count 0 419 # Exec time 15 13974.76s 30.15s 37.44s 33.35s # Lock time 0 1.8ms 2.0us 13.0us 4.3us # Rows sent 0 73.33k 175 175 175.00 # Rows examined 2 412.05M 965.28k 1.00M 983.41k # String: # Databases tpch # # EXPLAIN /!50100 PARTITIONS/ SELECT nation,o_year,SUM(amount) AS sum_profit FROM (SELECT n_name AS nation,EXTRACT(YEAR FROM o_orderdate) AS o_year,l_extendedprice(?-l_discount)-ps_supplycostl_quantity AS amount FROM ((((((part) JOIN supplier) JOIN lineitem) JOIN partsupp) JOIN orders) JOIN nation) WHERE s_suppkey=l_suppkey AND ps_suppkey=l_suppkey AND ps_partkey=l_partkey AND p_partkey=l_partkey AND o_orderkey=l_orderkey AND s_nationkey=n_nationkey AND p_name LIKE ?) AS profit GROUP BY nation,o_year ORDER BY nation,o_year DESC\G | 仿 PT 解析工具输出结果的文本字符串。 |
ExecuteCountRatio | Double | 0.03 | 执行总次数占比。 |
RowsExaminedRatio | Double | 1.77 | 扫描总行数占比。 |
RowsExaminedStats | Object | { "Max": 1003217, "Min": 965281, "Total": 412050589, "Average": 983414.2935560859 } | 扫描行数的统计结果。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
Name | String | name | 字段名称。 |
Type | String | varchar | 字段类型。 |
Length | String | 32 | 字段长度。 |
AllowBeNull | Bool | false | 字段是否允许为 NULL。 |
Comment | String | gender | 字段注释。 |
IsPrimaryKey | Bool | false | 字段是否为主键。 |
IsAutoIncrement | Bool | false | 字段是否为自增。 |
DefaultValue | String | male | 字段默认值。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
Name | String | mysql | 数据库名称。 |
CharacterSetName | String | utf8 | 数据库字符集名称。 |
CollationName | String | utf8_general_ci | 数据库排序集规则。 |
IsSystemDB | Bool | false | 数据库是否为系统库。 |
Description | String | 员工信息表 | 数据库描述信息。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
TimeStamp | Integer | 1787627086 | 数据点时间,使用秒级时间戳。 |
Value | Integer | 2 | 指标值。 |
Abnormal | Integer | 0 | 是否异常标记。当前接口通常返回 0。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
AccountType | String | CHILD | 账号类型。 |
GroupDetails | String[] | { "GroupId": "1962656497431244800", "GroupName": "1111" } | 用户组信息,包括用户组 ID 和用户组名称。 |
参数 | 类型 | 示例值 | 描述 | 支持的数据库类型 |
参数 | 类型 | 示例值 | 描述 | 支持的数据库类型 |
User | String | root | 执行者名称。 |
|
DB | String | information_schema | 数据库名称。 |
|
SourceIP | String | 127.0.0.1 | IP 地址。 |
|
OriSql | String | Select * from func; | 原始 SQL 文本。 说明 当需要执行多个 SQL 语句时,可使用英文分号(;)进行分割。 |
|
AffectRow | Integer | 0 | 影响行数。 |
|
ExecTime | Integer | 0 | 执行开始时间,单位:秒。 |
|
Duration | Integer | 0 | 执行持续时间,单位:微秒。 |
|
LogLevel | String | Normal | 日志等级,取值如下:
|
|
LogType | String | 查询操作 | 日志类型。常见的日志类型取值如下:
|
|
Table | String | tablename | 表名。 |
|
SqlMethod | String | SELECT | SQL 类型。取值如下:
|
|
NodeId | String | proxy-redis-cnlfxwjm8wl******-1 | 节点 ID。 |
|
ScanRows | Integer | 0 | 扫描行数。 |
|
WaitLockConsumingTime | Integer | 0 | 锁等待时间。 |
|
SessionId | String | 860422 | 会话 ID。 |
|
SqlFingerprint | String | d41d8cd98f00b204e9800998ecf****** | SQL 指纹。 |
|
ReturnRows | Integer | 1 | 返回行数。 |
|
参数 | 类型 | 示例值 | 描述 | 支持的数据库类型 |
参数 | 类型 | 示例值 | 描述 | 支持的数据库类型 |
DBName | String | order_db | 数据库名。 |
|
SessionID | String | 12345 | 会话 ID。 |
|
SqlType | String | SELECT | SQL 类型。取值包括:SELECT、INSERT、UPDATE、DELETE、ALTER、CREATE、DROP、RENAME、TRUNCATE、OTHER。 |
|
QueryString | String | select * from orders where id = 1 | 原始 SQL 文本。 |
|
StartTimestamp | String | 1787566212355943 | SQL 开始时间。 |
|
EndTimestamp | String | 1787566212356016 | SQL 结束时间。 |
|
ExecTime | Integer | 73 | 执行耗时。 |
|
CpuTime | Integer | 0 | CPU 耗时。 |
|
RowsExamined | Integer | 100 | 扫描行数。 |
|
RowAffected | Integer | 1 | 影响行数。 |
|
RowsSent | Integer | 10 | 返回行数。 |
|
UserName | String | app_user | 数据库用户名。 |
|
ClientIp | String | 10.0.0.10 | 客户端 IP。 |
|
ClientPort | String | 55880 | 客户端端口。 |
|
ServerPort | String | 3306 | 服务端口。 |
|
ExecErrorNo | String | 0 | SQL 执行错误码。 |
|
SqlFingerprint | String | a1b2c3d4 | SQL 指纹。 |
|
SqlTable | String | orders | 表名。 |
|
NodeId | String | node-a | 节点 ID。 |
|
SqlTemplate | String | select * from orders where id = ? | SQL 模板。 |
|
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
SnapshotTime | Integer | 1782349500 | 会话快照时间点。 |
ProcessID | String | 10000 | 会话ID。 |
User | String | test | 用户名。 |
Host | String | 192.168.1.100:6666 | 客户端IP。 |
DB | String | company | 数据库名称。 |
Command | String | Query | 命令类型。 |
State | String | executing | 状态。 |
Info | String | select * from employee | 执行语句。 |
LowerExecTimeLimit | String | 1 | 当前状态下的持续时间(秒)。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
SnapshotTime | Integer | 1782465540 | 会话快照时间点(单位:秒)。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
Timestamp | Integer | 1705525166 | 日志收集时间,使用秒时间戳格式。 |
LogLevel | String | Note | 错误日志级别。日志级别包括 Note、Warning、Error。 |
Content | String | Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. | 错误日志内容。 |
NodeId | String | mysql-898e213******-s58cb-0 | 所在节点 ID。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
NodeIds | Array of String | ["mysql-898e21******-s58cb-0"] | 节点 ID 列表信息。 |
LogLevel | Array of ErrLogLevel | ["Warning"] | 错误日志级别。取值如下:
|
Keyword | string | test1 | 关键词模糊查询。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
AssociatedInstanceNum | String | 1 | 当前审批流程被实例引用的次数。 |
ConfigId | String | 1811243361378508800 | 审批流程 ID。 |
ConfigName | String | cx-test-only | 审批流程名称。 |
CreateUser | String[] | { "UserId": "2100067216", "UserName": "RootAccount" } | 审批流程创建人信息,包括用户 ID 和用户名。 |
Memo | String | 管理员单点 | 审批流程的备注信息。 |
Type | String | Customize | 审批流程类型。返回值如下。
|
参数 | 类型 | 示例值 | 描述 |
参数 | 类型 | 示例值 | 描述 |
CreateTime | String | 2006-01-02 15:04:05 | 实例映射关系的创建时间,格式为 YYYY-MM-DD HH:mm:ss。 |
Deleted | Boolen | false | 实例的映射关系是否已被删除。取值如下:
|
FollowInstanceID | String | mysql-76eda4****** | 实例 ID。 |
InstanceID | String | DBW_FullSql_ed8b2b04-b985-4861-b19d-e0d2bd****** | 计费实例 ID。 |
ModifyTime | String | 2006-01-02 15:04:05 | 实例映射关系的修改时间,格式为 YYYY-MM-DD HH:mm:ss。 |
ProductType | String | FullSqlLog | 产品类型。 |
Region | String | cn-beijing | 实例 ID。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
ShowSleepConnection | Bool | true | 是否展示非活跃会话。取值如下:
|
ProcessID | String | 10000 | 会话 ID。 |
User | String | test | 用户名。 |
Host | String | 192.168.1.100:6666 | 客户端 IP。 |
DB | String | company | 数据库名称。 |
Command | String | Query | 命令类型。 |
State | String | Executing | 状态。 |
Info | String | select * from employee | 执行语句。 |
LowerExecTimeLimit | String | 1 | 当前状态下的持续时间(秒)。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
SQLAuditDetail | Boolean | true | SQL 审计明细是否已开启。取值如下:
|
SQLInsight | Boolean | true | SQL 洞察分析是否已开启。取值如下:
|
EnableHierarchicalStorage | Boolean | true | 是否启用冷热分层存储。取值如下:
|
参数 | 类型 | 示例值 | 描述 |
参数 | 类型 | 示例值 | 描述 |
Max | Double | 1250.0 | 最大值。 |
Min | Double | 1.0 | 最小值。 |
Total | Double | 28650.0 | 总数。 |
Average | Double | 114.6 | 平均值。 |
名称 | 类型 | 是否必选 | 示例值 | 描述 |
名称 | 类型 | 是否必选 | 示例值 | 描述 |
Action | String | 是 | Expand | 扩缩容配置,取值如下:
|
IsOpen | Boolen | 是 | true | 是否开启规则。取值如下;
|
Threshold | Integer | 是 | 48 | 触发规则的阈值。 |
ScalingLimit | String | 否 | 3000 | 扩缩容限制。取值范围为 20 GB~3000GB。 |
ObservationWindow | Integer | 否 | 5 | 单规则观测窗口。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
CommandStr | string | Select * from func; | 执行的语句内容。 |
State | String | Success | 命令执行状态,取值如下:
|
ReasonDetail | string | UnknownError | 当命令执行失败时,返回的信息。 |
RunTime | int64 | 1665741434000 | 执行 SQL 语句的开始时间戳,单位为:毫秒(ms)。 |
ColumnNames | array of String | [ "name", "ret", "dl", "type" ] | 执行查询脚本时,返回的结果集字段列表。 |
RowCount | long | 1000 | 列表的行的总数。 |
Rows | Array of Cell | [ { "Cells": [ "87", "01", "权限管理", "/admin/auth", "1" ] } ] | 列表的行的信息。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
TaskId | String | 2108115634582761472 | SQL 限流任务 ID。 |
RuleState | String | ACTIVE | SQL 限流任务状态,取值如下:
|
ThrottleTarget | String | MaxConcurrencyCount | 限流对象,当前仅支持 MaxConcurrencyCount 取值,表示 SQL 关键字限流。 |
KeyWords | String | select~from~test | SQL 关键字。 |
SqlType | String | SELECT | 需要限流的 SQL 类型,取值包括 SELECT、UPDATE、DELETE、INSERT、REPLACE。 |
TerminationType | String | Manual | SQL 限流任务结束方式,取值如下:
|
EffectiveTime | Integer | 10 | SQL 限流任务的限流时长,单位为分钟。 说明 在参数 TerminationType 取值设置为 Auto 时,返回该参数。 |
ConcurrencyCount | Integer | 0 | 每个节点的 SQL 语句的最大并发数。 |
CreateTime | String | 2025-12-25T12:00:00Z | SQL 限流任务的创建时间。 |
EndTime | String | 2025-12-25T12:10:00Z | SQL 限流任务的结束时间。 |
RemainingTime | Integer | 1 | SQL 限流任务的剩余时间。 |
RejectCount | Integer | 100 | SQL 限流任务的拒绝数。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 | 支持的数据库类型 |
参数 | 类型 | 是否必选 | 示例值 | 描述 | 支持的数据库类型 |
DBs | Array of String | 否 | [ "information_schema" ] | 数据库列表信息。 |
|
Users | Array of String | 否 | [ "rootgg" ] | 数据库账号列表信息。 |
|
SourceIPs | Array of String | 否 | [ "192.168.0.33" ] | IP 列表。 |
|
LogLevels | Array of String | 否 | ["Normal", "Incident", "Warning"] | 日志等级,取值如下:
|
|
LogType | Array of String | 否 | ["创建表", "查询操作"] | 日志类型。常见的日志类型取值如下:
|
|
DuringUp | Integer | 否 | 100 | 执行时间上限,单位:微秒。 |
|
DuringDown | Integer | 否 | 10 | 执行时间下限,单位:微秒。 |
|
AffectRowUp | Integer | 否 | 100 | 影响行数上限。 |
|
AffectRowDown | Integer | 否 | 100 | 影响行数下限。 |
|
SqlMethods | Array of String | 否 | ["SELECT", "INSERT"] | SQL 操作,取值如下:
|
|
Tables | Array of String | 否 | ["table1"] | 表名,从候选项中获取 |
|
SqlFingerprint | String | 否 | asdf-asdf-asdf-xxxxx | SQL 指纹。 |
|
NodeId | String | 否 | proxy-redis-xxxx | 节点 ID。 |
|
CmdKey | String | 否 | keyword | 关键词。 |
|
CommandResult | String | 否 | Success | SQL 命令执行结果,取值如下:
|
|
SqlFingerprints | Array of string | 否 | | SQL 指纹列表。建议传入。 |
|
SqlCommands | Array of string | 否 | | SQL 命令过滤条件。 |
|
KeyWords | Array of string | 否 | | SQL 关键字过滤条件。 |
|
ErrorNos | String | 否 | | 错误码过滤条件。 |
|
SessionIDs | Array of string | 否 | | 会话 ID 过滤条件。 |
|
DisplaySqlTemplate | String | 否 | true | 是否返回 SqlTemplate。取值如下:
|
|
CollectSqlFingerprint | String | 否 | true | 是否仅查询已采集 SQL 指纹的数据。取值如下:
|
|
LogTypes | Array of string | 否 | "SQL" | 日志类型过滤条件。 |
|
名称 | 类型 | 是否必选 | 示例值 | 描述 |
名称 | 类型 | 是否必选 | 示例值 | 描述 |
GroupIgnored | Array of String | 否 | ["SourceIP", "User"] | 聚合参数。可选参数如下所示:
|
DBs | Array of string | 否 | ["test1", "test2"] | 数据库名称。可输入多个数据库名称,需使用英文逗号(,)隔开。 |
Users | Array of string | 否 | ["root1", "root2"] | 用户名称。可输入多个用户名称,需使用英文逗号(,)隔开。 |
Keywords | Array of string | 否 | ["select", "insert"] | SQL 模版关键字。可输入多个关键字,需使用英文逗号(,)隔开。 |
MinQueryTime | Integer | 否 | 20 | 慢 SQL 的最小耗时时间,单位为秒(s)。 |
MaxQueryTime | Integer | 否 | 30 | 慢 SQL 的最大耗时时间,单位为秒(s)。 |
Collection | Array of string | 否 | ["test1", "test2"] | 文档数据库 MongoDB 版集合列表信息。 说明 在查询文档数据库 MongoDB 版实例的慢日志信息时,该参数可选配。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
InstanceType | String | MySQL | 数据库类型,当前支持的数据库如下所示。
|
Keyword | String | mysql default | 规则集名称。 |
SecurityGroupId | String | 1740264867044012032 | 规则集 ID。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
AssociatedInstanceNum | String | 10 | 关联实例的数量。 |
Category | String | Default | 规则集类型,返回值如下。
|
Comment | String | auto created by trigger 2100067216 | 备注信息。 |
ID | String | 1740264867044012032 | 安全规则集 ID。 |
InstanceType | String | MySQL | 数据库类型,当前支持的数据库如下所示。
|
Name | String | mysql default | 安全规则集名称。 |
UpdateTime | String | 1703746451 | 最近修改时间。 |
参数 | 类型 | 示例值 | 描述 |
参数 | 类型 | 示例值 | 描述 |
ConnectionId | Integer | 2145056 | 连接 ID。 |
DB | String | information_schema | 数据库名称。 |
LockTime | Float | 0 | 表示执行被查询对象时需要的锁等待时间,即查询对象可能在别的会话中被锁定,其他语言就需要等待锁释放才可以执行查询操作,这段时间就是锁等待时间。 |
QueryTime | Float | 3.000151 | 表示查询语句的耗时。 |
Timestamp | Integer | 1681097392 | 按照查询开始时间排序。 |
RowsExamined | Integer | 1 | 表示查询时需要扫描的行数。 |
RowsSent | Integer | 1 | 命中查询结果后返回数据的行数。 |
SQLTemplate | String | select sleep(?); | SQL 模板。 |
SQLText | String | select sleep(3);\n/usr/sbin/mysqld, Version: 8.0.26 (MySQL Community Server (GPL)). started with:\nTcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock\nTime Id Command Argument | SQL 文本即实际执行的查询语句。 |
SourceIP | String | 192.168.0.33 | IP 地址。 |
User | String | rootgg | 执行者名称。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
SQLTemplate | String | 否 | select * from test where id =? | SQL 模版。 |
DBs | Array of String | 否 | [test1,test2] | 数据库名称列表。 |
Users | Array of String | 否 | [root1,root2] | 用户名列表。 |
SourceIPs | Array of String | 否 | [127.0.0.1,127.0.0.2] | IP 列表。 |
MinQueryTime | Float | 否 | 0.05 | 最短执行耗时时间。 |
MaxQueryTime | Float | 否 | 1.05 | 最大执行耗时时间。 |
SQLTemplateID | String | 否 | a86e95364af941743630cf16d94d09788ee171af3397afafb89401cb6****** | SQL 模版 ID。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
TaskId | String | 2005543523536****** | 持续 Kill 任务的 ID。 |
CreateTime | String | 2025-12-29T07:36:51Z | 持续 Kill 任务的创建时间。 |
State | String | DONE | 持续 Kill 任务状态,取值如下:
|
SqlType | String | select,update,insert,delete | 持续 Kill 任务的 SQL 类型。取值包括 select、update、delete、insert。 |
NodeType | String | Primary,ReadOnly | 持续 Kill 任务的节点类型。取值包括 Primary(主节点)、ReadOnly(只读节点)。 |
MaxExecTime | Integer | 1 | SQL 执行时长,表示超过该时长的 SQL 请求会被 Kill。单位为秒(s),取值范围为 1~9999。 |
EffectiveTime | Integer | 60 | 任务持续时长,表示当持续 Kill 任务达到持续时长后,任务将被自动关闭。单位为秒(s),取值范围为 1~99999999。 |
RemainingTime | Integer | 0 | 持续 Kill 任务的剩余时长,单位为秒(s)。 |
User | String | RootAccount | 持续 Kill 任务的创建者。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
Name | String | employee | 表名称。 |
Engine | String | InnoDB | 存储引擎。 |
CharacterSet | String | utf8mb4 | 表字符集。 |
Collations | String | utf8mb4_general_ci | 表校验规则。 |
Definition | String | CREATE TABLE employee (\n id bigint(11) NOT NULL AUTO_INCREMENT,\n name varchar(60) NOT NULL,\n age smallint(10) NOT NULL,\n city varchar(60) NOT NULL,\n department varchar(60) NOT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB AUTO_INCREMENT=16394 DEFAULT CHARSET=utf8mb4 | 建表 DDL 语句。 |
Columns | Array of Column | 表字段元信息列表 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
Key | String | 是 | 标签键。命名规则如下:
|
Value | String | 是 | 标签值。命名规则如下:
|
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
SqlFingerprint | String | a1b2c3d4 | SQL 指纹。 |
DbName | String | order_db | 数据库名。 |
TbName | String | orders | 表名。 |
SqlType | String | SELECT | SQL 类型。取值包括:SELECT、INSERT、UPDATE、DELETE、ALTER、CREATE、DROP、RENAME、TRUNCATE、OTHER。 |
FirstTemplatesDetail | { "BinlogSyncTime": 0, "BytesSent": 0, "CclWaitTime": 0, "Count": 2, "CpuTime": 490, "DBName": "test_zhudi", "ExecTime": 794, "GroupFollowerWaitTime": 0, "InnodbIoReadBytes": 0, "InnodbIoReads": 0, "InnodbPageAccess": 16, "InstanceID": "mysql-cf8d83a2ea63", "IsCollectSqlFingerprint": false, "LatchWaitTime": 0, "MdlWaitTime": 0, "RedoLogFlushTime": 0, "RowlockWaitTime": 0, "RowsAffected": 0, "RowsExamined": 4, "RowsSent": 0, "SemiSyncWaitTime": 0, "ServerPort": "", "SocketSendTime": 0, "SqlFingerprint": "01c4dbcc021b24e3beff902d78115f5e", "SqlTable": "TABLES", "SqlTemplate": "SELECT `TABLE_NAME` FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA`=? AND `TABLE_TYPE` IN (?+) LIMIT ?+", "SqlType": "SELECT", "TablelockWaitTime": 0, "TcCommitTime": 0, "TcFlushTime": 0, "TenantID": "2100067216", "ThreadSchedTime": 3, "ThreadWaitTime": 0, "TmpDiskTables": 0, "TotalCpuTime": 980, "TotalExecTime": 1588, "TrxCommitTime": 0, "WaitLockTime": 0 } | 第一个时间段的聚合指标。 | |
SecondTemplatesDetail | { "BinlogSyncTime": 0, "BytesSent": 0, "CclWaitTime": 0, "Count": 14, "CpuTime": 0, "DBName": "test_zhudi", "ExecTime": 8, "GroupFollowerWaitTime": 0, "InnodbIoReadBytes": 0, "InnodbIoReads": 0, "InnodbPageAccess": 0, "InstanceID": "mysql-cf8d83a2ea63", "IsCollectSqlFingerprint": false, "LatchWaitTime": 0, "MdlWaitTime": 0, "RedoLogFlushTime": 0, "RowlockWaitTime": 0, "RowsAffected": 0, "RowsExamined": 0, "RowsSent": 0, "SemiSyncWaitTime": 0, "ServerPort": "", "SocketSendTime": 0, "SqlFingerprint": "quit", "SqlTable": "-", "SqlTemplate": "", "SqlType": "Quit", "TablelockWaitTime": 0, "TcCommitTime": 0, "TcFlushTime": 0, "TenantID": "2100067216", "ThreadSchedTime": 5, "ThreadWaitTime": 0, "TmpDiskTables": 0, "TotalCpuTime": 0, "TotalExecTime": 113, "TrxCommitTime": 0, "WaitLockTime": 0 } | 第二个时间段的聚合指标。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
MetricName | String | 磁盘使用率 | 指标名称。 |
ComparisonOperator | String | >= | 比较操作符。返回为 ASCII 码,您可自行用 Unicode 转义序列解码。 |
Threshold | String | 90% | 阈值。 |
TimeInfo | String | 5m | 时间信息,为定时扩缩容准备。 |
名称 | 类型 | 示例值 | 描述 |
名称 | 类型 | 示例值 | 描述 |
IsItemCanBeIgnore | Boolen | true | 该项是否允许被自动忽略,取值如下:
|
IsItemIgnored | Boolen | true | 该检查项是否已被忽略,取值如下:
|
ItemDetails | Array of string | [ { "Result": "Pass", "SQL": "INSERT INTO `tb1` (name, age, phone) VALUES ('王五', 28, '13800138000');" } ] | |
ItemName | String | 权限检查 | 预检查项名称。 |
PreCheckItem | String | Permission | 检查项的分类。取值如下:
|
PreCheckState | String | Success | 预检查项的当前状态。取值如下:
|
Result | String | Pass | 预检查项的检查结果,取值如下:
|
名称 | 类型 | 描述 | 示例值 |
名称 | 类型 | 描述 | 示例值 |
Result | String | 需要执行的 SQL 语句在检查项的的检查结果。 | Pass |
SQL | String | 需要执行的 SQL 语句。 | INSERT INTO `tb1` (name, age, phone) VALUES ('王五', 28, '13800138000'); |