You need to enable JavaScript to run this app.
导航
ReqSlowList
最近更新时间:2024.07.12 17:21:39首次发布时间:2022.11.18 15:32:34

获取top10慢请求。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com/?Action=ReqSlowList&Version=2022-10-12
ServiceName: apmplus_openapi
Region: cn-beijing 
X-App-Ids: xxx
Content-Type: application/json

请求参数

Query

参数类型是否必选示例值描述
ActionStringReqSlowList接口名称。当前 API 的名称为 ReqSlowList
VersionString2022-10-12接口版本。当前 API 的版本为 2022-10-12

Body

参数类型是否必选示例值描述
commonObject of CommonParams-通用参数。
time_filterObject of TimeFilter-时间区间。
filter_conditionsObject of FilterCondition-筛选条件。
slow_durationLong2000慢请求阈值,单位ms。
order_byStringslow_rate排序方式。支持按照slow_rate、slow_value、count、avg、pct25、pct50、pct70、pct90和pct99排序。
typeStringavg请求耗时聚合方式。支持按照avg、pct25、pct50、pct70、pct90、pct95和pct99聚合。

CommonParams

参数类型是否必选示例值描述
aidLong12345应用ID。
site_typeStringweb站点类型。
envStringonline环境,填""时为全部。
osStringwebpro服务类型,可选值为webproappminipro
userStringtest_user用户名。

TimeFilter

参数类型是否必选示例值描述
start_timeInteger1665485413起始时间,单位s。
end_timeInteger1665744613终止时间,单位s。
granularityInteger3600聚合时间粒度,单位s。

FilterCondition

参数类型是否必选示例值描述
typeStringand筛选条件类型,可选值为andrule,只支持两层,第一层的type必须为and,第二层的type必须为rule。
fieldStringpid条件字段key,可选值集合由GetFieldKeys方法获取。
opStringin条件符号,可选值有eq,neq,lt,lte,gt,gte,in,not_in,regex,not_regex。
groupKeyStringcontextmap类型字段key,可选值集合由GetFieldKeys方法获取。
valuesArray of String[数据探索]条件值,可选值集合由GetFieldValues方法获取。
childrenArray of FilterCondition-如果下层还有条件,则放入该处,即type为and时必填。这一层与field,op,groupkey以及values不能同时存在。

返回参数

参数类型示例值描述
dataArray of ReqSlowListItem-Top10慢请求。
error_msgString-错误信息,成功为空。
error_noInteger0错误码,成功为0。

ReqSlowListItem

参数类型示例值描述
pathStringpath_test请求路径。
domainStringwww.test.com请求域名。
durationLong1200请求耗时,单位ms。
slow_rateString0.12慢请求率。
user_rateString0.12慢请求影响用户率。
rate_trendObject of ChartData-慢请求率趋势。
user_trendObject of ChartData-慢请求影响用户率趋势。
duration_trendObject of ChartData-请求耗时趋势。

ChartData

参数类型示例值描述
fieldsArray of Field-折线图/饼图维度,len(fields)=len(source[i])。
sourceArray of String[["1668355200","js_error","0","0"]]趋势图具体点的集合,len(source)为折线图点的数量或者饼图中块数量。

Field

参数类型示例值描述
idStringdate维度key。
nameString日期维度名。
dataTypeStringstring维度类型。
aggregateString-聚合方式。

请求示例

POST https://open.volcengineapi.com/?Action=ReqSlowList&Version=2022-10-12
{
    "common": {
        "aid": 12345,
        "site_type": "web",
        "env": "online",
        "os": "webpro",
        "user": "test_user"
    },
    "time_filter": {
        "start_time": 1665485413,
        "end_time": 1665744613,
        "granularity": 3600
    },
    "slow_duration": 2000,
    "type": "avg,pct25,pct50,pct70,pct90,pct95,pct99",
    "filter_conditions": {
        "type": "and",
        "children": [
            {
                "type": "and",
                "op": "in",
                "groupKey": "context",
                "children": [],
                "values": "[数据探索]",
                "field": "pid"
            }
        ],
        "values": "[数据探索]",
        "groupKey": "context",
        "field": "pid",
        "op": "in"
    },
    "order_by": "slow_rate,slow_value,count,avg,pct25,pct50,pct70,pct90,pct99"
}

返回示例

{
    "error_msg": "",
    "data": [
        {
            "domain": "www.test.com",
            "user_trend": {
                "fields": [
                    {
                        "dataType": "string",
                        "aggregate": "",
                        "id": "date",
                        "name": "日期"
                    }
                ],
                "source": [
                    [
                        "1668355200",
                        "js_error",
                        "0",
                        "0"
                    ]
                ]
            },
            "duration": 1200,
            "user_rate": "0.12",
            "duration_trend": {
                "fields": [
                    {
                        "name": "日期",
                        "id": "date",
                        "aggregate": "",
                        "dataType": "string"
                    }
                ],
                "source": [
                    [
                        "1668355200",
                        "js_error",
                        "0",
                        "0"
                    ]
                ]
            },
            "slow_rate": "0.12",
            "rate_trend": {
                "fields": [
                    {
                        "dataType": "string",
                        "name": "日期",
                        "aggregate": "",
                        "id": "date"
                    }
                ],
                "source": [
                    [
                        "1668355200",
                        "js_error",
                        "0",
                        "0"
                    ]
                ]
            },
            "path": "path_test"
        }
    ],
    "error_no": 0
}

错误码

本接口无特有的错误码。更多信息请参见错误码