You need to enable JavaScript to run this app.
导航

ResourceSlowList

最近更新时间2023.12.26 18:54:58

首次发布时间2022.11.18 15:32:35

调用ResourceSlowList接口获取静态资源慢加载top10列表。

使用说明

  • 接口名称:ResourceSlowList
  • 请求方式:POST
  • 接口地址:/?Action=ResourceSlowList&Version=2022-10-12

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

ResourceSlowList

请求名称。

Version

String

2022-10-12

请求版本。

ServiceName : apmplus_openapi
Region : cn-beijing 
X-App-Ids : xxx
Content-Type : application/json

Body

参数

类型

是否必选

示例值

描述

common

object of common

-

通用参数。

time_filter

object of time_filter

-

时间区间。

filter_conditions

object of filter_conditions

-

筛选条件。

slow_duration

i64

3000

慢加载阈值。

order_by

string

count

排序依据。

  • count
  • slow_rate
  • slow_value
  • avg
  • pct25
  • pct50
  • pct70
  • pct90
  • pct99

pick_type

string

avg

加载总耗时聚合方式。

  • avg
  • pct25
  • pct50
  • pct70
  • pct90
  • pct99

参数

类型

是否必选

示例值

描述

common

调用ResourceSlowList接口获取静态资源慢加载top10列表。

使用说明

  • 接口名称:ResourceSlowList
  • 请求方式:POST
  • 接口地址:/?Action=ResourceSlowList&Version=2022-10-12

请求参数

Query

Header

Body

common

time_filter

filter_conditions

children

返回参数

data

duration_trend

user_trend

rate_trend

fields

示例

请求示例

正常返回示例

异常返回示例

object of commoncommon

通用参数

time_filter

object of time_filtertime_filter

时间区间

filter_conditions

object of filter_conditionsfilter_conditions

筛选条件

slow_duration

i64

3000

慢加载阈值

order_by

string

count,slow_rate,slow_value,avg,pct25,pct50,pct70,pct90,pct99

排序依据

pick_type

string

avg,pct25,pct50,pct70,pct90,pct99

加载总耗时聚合方式

common

参数

类型

是否必选

示例值

描述

aid

i64

12345

应用ID。

site_type

string

web

站点类型。

env

string

online

环境,填""时为全部。

os

string

webpro

服务类型,可选值为webproappminipro

user

string

test_user

用户名。

time_filter

参数

类型

是否必选

示例值

描述

start_time

i32

1665485413

起始时间,单位s。

granularity

i32

3600

聚合时间粒度,单位s。

end_time

i32

1665744613

终止时间,单位s。

filter_conditions

参数

类型

是否必选

示例值

描述

type

string

and

筛选条件类型,可选值为andrule,只支持两层,第一层的type必须为and,第二层的type必须为rule。

field

string

pid

条件字段key,可选值集合由GetFieldKeys方法获取。

op

string

in

条件符号,可选值有eq,neq,lt,lte,gt,gte,in,not_in,regex,not_regex。

groupKey

string

context

map类型字段key,可选值集合由GetFieldKeys方法获取。

values

array of string

[数据探索]

条件值,可选值集合由GetFieldValues方法获取。

children

array of children

-

如果下层还有条件,则放入该处,这一层与field,op,groupkey以及values不能同时存在。

children

参数

类型

是否必选

示例值

描述

type

string

and

筛选条件类型,可选值为andrule,只支持两层,第一层的type必须为and,第二层的type必须为rule。

field

string

pid

条件字段key,可选值集合由GetFieldKeys方法获取。

op

string

in

条件符号,可选值有eq,neq,lt,lte,gt,gte,in,not_in,regex,not_regex。

groupKey

string

context

map类型字段key,可选值集合由GetFieldKeys方法获取。

values

array of string

[数据探索]

条件值,可选值集合由GetFieldValues方法获取。

children

array of string

-

如果下层还有条件,则放入该处,这一层与field,op,groupkey以及values不能同时存在。

返回参数

参数

类型

示例值

描述

data

object of data

-

Top10慢请求。

error_no

i32

0

错误码,成功为0。

error_msg

string

-

错误信息,成功为空。

data

参数

类型

示例值

描述

name

string

data:image/svg+xml

静态资源地址。

type

string

resource

静态资源类型。

duration

i64

-

请求耗时,单位ms。

slow_rate

string

-

慢请求率。

user_rate

string

-

慢请求影响用户率。

duration_trend

object of duration_trend

-

请求耗时趋势。

user_trend

object of user_trend

-

慢请求影响用户率趋势。

rate_trend

object of rate_trend

-

慢请求率趋势。

duration_trend

参数

类型

示例值

描述

fields

array of fields

-

折线图/饼图维度,len(fields)=len(source[i])。

source

array of string

[["1668355200","js_error","0","0"]]

趋势图具体点的集合,len(source)为折线图点的数量或者饼图中块数量。

user_trend

参数

类型

示例值

描述

fields

array of fields

-

折线图/饼图维度,len(fields)=len(source[i])。

source

array of string

[["1668355200","js_error","0","0"]]

趋势图具体点的集合,len(source)为折线图点的数量或者饼图中块数量。

rate_trend

参数

类型

示例值

描述

fields

array of fields

-

折线图/饼图维度,len(fields)=len(source[i])。

source

array of string

[["1668355200","js_error","0","0"]]

趋势图具体点的集合,len(source)为折线图点的数量或者饼图中块数量。

fields

参数

类型

示例值

描述

id

string

date

维度key。

dataType

string

string

维度类型。

name

string

日期

维度名。

aggregate

string

-

聚合方式。

请求示例

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

返回示例

正常返回示例

{
    "error_no": 0,
    "data": [
        {
            "user_trend": {
                "source": [
                    [
                        "1668355200",
                        "js_error",
                        "0",
                        "0"
                    ]
                ],
                "fields": [
                    {
                        "dataType": "string",
                        "name": "日期",
                        "id": "date",
                        "aggregate": ""
                    }
                ]
            },
            "type": "resource",
            "slow_rate": "at",
            "duration": 723,
            "rate_trend": {
                "fields": [
                    {
                        "name": "日期",
                        "dataType": "string",
                        "id": "date",
                        "aggregate": ""
                    }
                ],
                "source": [
                    [
                        "1668355200",
                        "js_error",
                        "0",
                        "0"
                    ]
                ]
            },
            "user_rate": "",
            "name": "data:image/svg+xml",
            "duration_trend": {
                "source": [
                    [
                        "1668355200",
                        "js_error",
                        "0",
                        "0"
                    ]
                ],
                "fields": [
                    {
                        "name": "日期",
                        "dataType": "string",
                        "aggregate": "",
                        "id": "date"
                    }
                ]
            }
        }
    ],
    "error_msg": ""
}

异常返回示例

{
    "ResponseMetadata": {
        "RequestId": "201806041104200100100232280022D30",
        "Action": "ResourceSlowList",
        "Version": "2022-10-12",
        "Service": "***",
        "Region": "cn-north-1",
        "Error": {
            "Code": "200000",
            "Message": "参数异常"
        }
    }
}