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

PageOverview

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

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

调用PageOverview接口获取页面性能指标总览。

使用说明

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

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

PageOverview

请求名称。

Version

String

2022-10-12

请求版本。

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

Body

参数

类型

是否必选

示例值

描述

time_filter

object of time_filter

-

时间区间。

common

object of common

-

通用参数。

filter_conditions

object of filter_conditions

-

筛选条件。

type

string

avg

性能指标聚合方式。

time_filter

参数

类型

是否必选

示例值

描述

start_time

i32

1665485413

起始时间,单位s。

granularity

i32

3600

聚合时间粒度,单位s。

end_time

i32

1665744613

终止时间,单位s。

common

参数

类型

是否必选

示例值

描述

aid

i64

12345

应用ID。

site_type

string

web

站点类型。

env

string

online

环境,填""时为全部。

os

string

webpro

服务类型,可选值为webproappminipro

user

string

test_user

用户名。

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

array of data

-

性能指标总览情况。

error_msg

string

-

错误信息,成功为空。

error_no

i32

0

错误码,成功为0。

data

参数

类型

示例值

描述

metric

string

fp

性能指标key。

desc

string

-

性能指标描述。

status

object of status

-

性能指标值状态评估,符合预期,高于预期或低于预期。

trend

object of trend

-

性能指标值变化趋势。

bounce_rate

object of bounce_rate

-

性能指标跳出率变化趋势。

distribution

object of distribution

-

性能指标值分布。

status

参数

类型

示例值

描述

level

i8

0

等级。

  • 0:严重低于预期
  • 1:略低于预期
  • 2:符合预期
  • 3:高于预期

unit

string

ms

性能指标单位。

value

string

1234

性能指标值。

down_base_line

double

1001

性能指标基准线下限。

up_base_line

double

2500

性能指标基准线上限,在上下限之间属于符合预期。

trend

参数

类型

示例值

描述

data

object of data

-

性能指标值变化趋势。

extra

object of extra

-

性能指标值额外信息。

bounce_rate

参数

类型

示例值

描述

data

object of data

-

性能指标值变化趋势。

extra

object of extra

-

性能指标值额外信息。

distribution

参数

类型

示例值

描述

data

object of data

-

性能指标值分布。

extra

object of extra

-

性能指标聚合值。

data

参数

类型

示例值

描述

fields

array of fields

-

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

source

array of string

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

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

extra

参数

类型

示例值

描述

benchmark

double

2005

性能指标基准线上限。

type

string

count,rate

性能指标值单位。

extra

参数

类型

示例值

描述

label

string

avg,pct50,pct75,pct90,pct95

性能指标聚合方式。

value

double

1234

性能指标聚合值。

up

double

2500

性能指标基准线上限。

down

double

1001

性能指标基准线下限。

granularity

string

50

分布图间隔性能指标值分布间隔。

fields

参数

类型

示例值

描述

id

string

date

维度key。

dataType

string

string

维度类型。

name

string

日期

维度名。

aggregate

string

-

聚合方式。

请求示例

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

返回示例

正常返回示例

{
    "error_msg": "",
    "data": [
        {
            "trend": {
                "data": {
                    "fields": [
                        {
                            "id": "date",
                            "aggregate": "",
                            "name": "日期",
                            "dataType": "string"
                        }
                    ],
                    "source": [
                        [
                            "1668355200",
                            "js_error",
                            "0",
                            "0"
                        ]
                    ]
                },
                "extra": {
                    "benchmark": 2005,
                    "type": "count,rate"
                }
            },
            "status": {
                "value": "1234",
                "up_base_line": 2500,
                "level": 0,
                "unit": "ms",
                "down_base_line": 1001
            },
            "desc": "",
            "distribution": {
                "extra": {
                    "value": 1234,
                    "down": 1001,
                    "label": "avg,pct50,pct75,pct90,pct95",
                    "up": 2500,
                    "granularity": "50"
                },
                "data": {
                    "fields": [
                        {
                            "aggregate": "",
                            "dataType": "string",
                            "name": "日期",
                            "id": "date"
                        }
                    ],
                    "source": [
                        [
                            "1668355200",
                            "js_error",
                            "0",
                            "0"
                        ]
                    ]
                }
            },
            "metric": "fp",
            "bounce_rate": {
                "data": {
                    "fields": [
                        {
                            "dataType": "string",
                            "name": "日期",
                            "aggregate": "",
                            "id": "date"
                        }
                    ],
                    "source": [
                        [
                            "1668355200",
                            "js_error",
                            "0",
                            "0"
                        ]
                    ]
                },
                "extra": {
                    "benchmark": 2005,
                    "type": "count,rate"
                }
            }
        }
    ],
    "error_no": 0
}

异常返回示例

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