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

GetAppBatteryPageList

最近更新时间2024.04.25 17:57:50

首次发布时间2024.04.25 17:57:50

获取App电量前台列表。

请求说明

  • 请求方式:POST
  • 请求地址:?Action=GetAppBatteryPageList&Version=2024-04-09

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

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAppBatteryPageList

接口名称。当前 API 的名称为 GetAppBatteryPageList

Version

String

2024-04-09

接口版本。当前 API 的版本为 2024-04-09

Body

参数

类型

是否必选

示例值

描述

start_time

Integer

1619827200

查询起始时间(Unix时间戳)。

end_time

Integer

1619913600

查询结束时间(Unix时间戳)。

filters

Object of Condition

-

筛选条件,可以指定多个键值对来筛选数据。

page_no

Integer

1

查询的页码。

page_size

Integer

20

每页显示的数量。

metrics

String

battery_usage

用于查询的电池指标名称。

order_by

String

avg_ascend

排序依据。

  • avg_ascend:按平均值升序排列
  • avg_descend:按平均值降序排列
  • pct25_ascend:按25分位值升序排列
  • pct25_descend:按25分位值降序排列
  • pct50_ascend:按50分位值升序排列
  • pct50_descend:按50分位值降序排列
  • pct75_ascend:按75分位值升序排列
  • pct75_descend:按75分位值降序排列
  • pct90_ascend:按90分位值升序排列
  • pct90_descend:按90分位值降序排列
  • pct99_ascend:按99分位值升序排列
  • pct99_descend:按99分位值降序排列
  • statistics_cnt_ascend:按统计量升序排列
  • statistics_cnt_descend:按统计量降序排列

scene

String

HomePage

页面名称搜索词。

Condition

参数

类型

是否必选

示例值

描述

op

String

in

操作符。

  • gt:大于
  • gte:大于等于
  • lt:小于
  • lte:小于等于
  • eq:等于
  • neq:不等于
  • in:包含
  • not_in:不包含
  • lk:like
  • nlk:not like
  • regex:正则匹配
  • not_null:非正则匹配

type

String

expression

筛选条件类型。

  • expression:当前condition是一个表达式
  • and:当前condition是一个复合表达式,多个sub_condition的逻辑关系是and
  • or:当前condition是一个复合表达式,多个sub_condition的逻辑关系是or
  • map:当前condition是map类型

value

String

123456

筛选值。

values

Array of String

[123456]

筛选值,支持多个。

map_key

String

key_1

map类型key,当type为map时必填。

dimension

String

aid

条件的名称。

sub_conditions

Array of Condition

-

子条件。

返回参数

参数

类型

示例值

描述

data

Object of SearchResponseData

-

返回内容

error_msg

String

-

错误信息。

error_no

Integer

0

错误码。

SearchResponseData

参数

类型

示例值

描述

total

Integer

10

列表总数

result

Array of BatteryScenePageItem

-

列表详情。

BatteryScenePageItem

参数

类型

示例值

描述

pct25

Double

10.5

25百分位值。

pct50

Double

14.0

50百分位值(中位数)。

pct75

Double

17.8

75百分位值。

pct90

Double

19.6

90百分位值。

pct99

Double

23.4

99百分位值。

scene

String

HomePage

页面名称。

avg_value

Double

15.2

平均指标值。

statistics_cnt

Double

200

样本数量。

请求示例

POST ?Action=GetAppBatteryPageList&Version=2024-04-09
{
    "start_time": 1619827200,
    "end_time": 1619913600,
    "filters": {
        "type": "and",
        "sub_conditions": [
            {
                "dimension": "apm_version",
                "type": "expression",
                "op": "in",
                "values": [
                    "1.4.5"
                ]
            },
            {
                "dimension": "device_model",
                "type": "expression",
                "op": "in",
                "values": [
                    "MI 5X"
                ]
            }
        ]
    },
    "page_no": 1,
    "page_size": 20,
    "metrics": "battery_usage",
    "order_by": "avg_ascend",
    "scene": "HomePage"
}

返回示例

{
    "data": {
        "total": 10,
        "result": [
            {
                "pct25": 10.5,
                "pct50": 14,
                "pct75": 17.8,
                "pct90": 19.6,
                "pct99": 23.4,
                "scene": "HomePage",
                "avg_value": 15.2,
                "statistics_cnt": 200
            }
        ]
    },
    "error_msg": "",
    "error_no": 0
}