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

GetAppBatteryConsumptionFactorsEventList

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

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

获取App耗电事件列表。

请求说明

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

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

请求参数

Query

参数

类型

是否必选

示例值

描述

Action

String

GetAppBatteryConsumptionFactorsEventList

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

Version

String

2024-04-09

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

Body

参数

类型

是否必选

示例值

描述

start_time

Integer

1619827200

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

end_time

Integer

1619913600

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

filters

Object of Condition

-

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

bddid

String

bdd123456789

device ID。

calculation_method

String

all

计算方式。

  • all:全生命周期
  • per_min:每分钟平均

only_back

Integer

1

是否后台。

  • 1:后台
  • 0:前台

order_by

String

traffic_p_capacity_ascend

排序依据。

  • traffic_p_capacity_ascend:流量升序
  • traffic_p_capacity_descend:流量降序
  • loc_p_time_ascend:获取location时长升序
  • loc_p_time_descend:获取location时长降序
  • alarm_ascend:AlarmManager设置次数升序
  • alarm_descend:AlarmManager设置次数降序
  • power_p_time_ascend:WakeLock唤醒时长升序
  • power_p_time_descend:WakeLock唤醒时长降序
  • p_time_ascend:进程存活时间升序
  • p_time_descend:进程存活时间降序
  • api_time_ascend:上报时间升序
  • api_time_descend:上报时间降序
  • event_time_ascend:发生时间升序
  • event_time_descend:发生时间降序

page_no

Integer

1

查询的页码。

page_size

Integer

20

每页显示的数量。

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 ListBatterySummaryEventData

-

返回内容。

error_msg

String

-

错误信息。

error_no

Integer

0

错误码。

ListBatterySummaryEventData

参数

类型

示例值

描述

total

Integer

10

列表总数。

result

Array of ListBatterySummaryEvent

-

列表详情。

ListBatterySummaryEvent

参数

类型

示例值

描述

alarm

Double

0.1

AlarmManager设置次数。

bddid

String

bdd123456789

设备ID。

p_time

Double

0.4

进程存活时长。

is_back

Integer

1

是否后台事件。

  • 1:后台
  • 0:前台

api_time

Long

1619827200

上报时间。

event_id

String

event_12345

事件ID。

event_time

Long

1619827230

事件发生时间。

loc_p_time

Double

0.3

获取Location时长。

power_p_time

Double

0.2

WakeLock唤醒时长。

process_name

String

com.example.app

进程名称。

traffic_p_capacity

Double

0.5

电量相关流量消耗。

请求示例

POST ?Action=GetAppBatteryConsumptionFactorsEventList&Version=2024-04-09
{
    "start_time": 25,
    "end_time": 421,
    "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"
                ]
            }
        ]
    },
    "bddid": "American",
    "calculation_method": "all",
    "only_back": 1,
    "order_by": "traffic_p_capacity_ascend",
    "page_no": 1,
    "page_size": 20
}

返回示例

{
    "data": {
        "total": 2,
        "result": [
            {
                "alarm": 376,
                "bddid": "arm",
                "p_time": 565,
                "is_back": 181,
                "api_time": 214,
                "event_id": "Public",
                "event_time": 528,
                "loc_p_time": 739,
                "power_p_time": -92,
                "process_name": "hands",
                "traffic_p_capacity": 388
            }
        ]
    },
    "error_msg": "",
    "error_no": 0
}