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

获取性能劣化top5页面列表。

请求说明

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

请求参数

Query

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

Body

参数类型是否必选示例值描述
time_filterObject of TimeFilter-时间区间。
commonObject of CommonParams-通用参数。
filter_conditionsObject of FilterCondition-筛选条件。
metricStringfp排序性能指标key。支持按照fp、fcp、fmp、tti、load和lcp。
typeStringavg排序性能指标聚合方式。支持的聚合方式有avg、pct50、pct75、pct90和pct95。
min_countInteger1样本量阈值,低于阈值的页面不参与计算。

TimeFilter

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

CommonParams

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

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 PerfChangeItem-性能优化/劣化top5页面列表。
error_msgString-错误信息,成功为空。
error_noInteger0错误码,成功为0。

PerfChangeItem

参数类型示例值描述
toLong2345所选时间区间下半时间周期性能指标值。
pidStringpath_test页面ID。
fromLong1234所选时间区间上半时间周期性能指标值。
extraObject of TrendExtra-所选时间区间内的版本发布情况。
trendObject of ChartData-性能指标变化趋势。

TrendExtra

参数类型示例值描述
release_infoArray of ReleaseInfo-版本发布情况。

ChartData

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

ReleaseInfo

参数类型示例值描述
envStringtest版本发布环境。
commitString[]版本相关commit。
releaseStringv2.2.123版本。
create_atInteger1668483578版本发布时间。

Field

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

请求示例

POST https://open.volcengineapi.com/?Action=DeteriorationPerf&Version=2022-10-12
{
    "time_filter": {
        "start_time": 1665485413,
        "end_time": 1665744613,
        "granularity": 3600
    },
    "common": {
        "aid": 12345,
        "site_type": "web",
        "env": "online",
        "os": "webpro",
        "user": "test_user"
    },
    "metric": "fp,fcp,fmp,tti,load,lcp",
    "type": "avg,pct50,pct75,pct90,pct95",
    "filter_conditions": {
        "type": "and",
        "children": [
            {
                "type": "and",
                "op": "in",
                "field": "pid",
                "values": "[数据探索]",
                "groupKey": "context",
                "children": []
            }
        ],
        "op": "in",
        "groupKey": "context",
        "field": "pid",
        "values": "[数据探索]"
    },
    "min_count": 1
}

返回示例

{
    "error_msg": "",
    "error_no": 0,
    "data": [
        {
            "trend": {
                "source": [
                    [
                        "1668355200",
                        "js_error",
                        "0",
                        "0"
                    ]
                ],
                "fields": [
                    {
                        "id": "date",
                        "aggregate": "",
                        "name": "日期",
                        "dataType": "string"
                    }
                ]
            },
            "to": 2345,
            "pid": "path_test",
            "extra": {
                "release_info": [
                    {
                        "create_at": 1668483578,
                        "env": "test",
                        "release": "v2.2.123",
                        "commit": ""
                    }
                ]
            },
            "from": 1234
        }
    ]
}

错误码

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