You need to enable JavaScript to run this app.
Application Performance Management Plus

Application Performance Management Plus

Copy page
Download PDF
Battery monitoring
GetAppBatteryTrend
Copy page
Download PDF
GetAppBatteryTrend
Get trends of foreground current and battery temperature related to app power consumption.​
Request description​
RUM is deployed across multiple regions worldwide to provide more stable and low-latency access. You can refer to the Service addresses topic to choose the most suitable access point based on your business location.​
  • Request method: POST​
  • Request URL: https://apmplus-openapi.cn-beijing.volcengineapi.com?Action=GetAppBatteryTrend&Version=2022-10-12​
Request parameters​
The following table lists only the request parameters specific to this API and some public parameters. For details, see Public parameters.​
​
Parameters​
Type​
Required​
Sample value​
Description​
Action​
String​
Yes​
GetAppBatteryTrend​
The API name. The current API name is GetAppBatteryTrend.​
Version​
String​
Yes​
2022-10-12​
The API version. The current API version is 2022-10-12.​
start_time​
Integer​
No​
1617225600​
Query start time (Unix timestamp).​
end_time​
Integer​
No​
1617312000​
Query end time (Unix timestamp).​
filters​
Object of Condition​
No​
-​
The filter condition. You can specify multiple key‑value pairs to filter data.​
granularity​
Integer​
No​
5​
Aggregation granularity, in minutes.​
metrics​
String​
No​
battery_electric​
Metric name to query​
statistic_scale​
String​
No​
avg​
Statistical scope.​
  • avg​
  • pct25​
  • pct50​
  • pct75​
  • pct90​
  • pct99​
scene​
String​
No​
main_activity​
Page name.​
​
Condition​
​
Parameters​
Type​
Required​
Sample value​
Description​
op​
String​
No​
in​
The operator.​
  • gt: greater than​
  • gte: greater than or equal to​
  • lt: less than​
  • lte: less than or equal to​
  • eq: equal to​
  • neq: not equal to​
  • in: contains​
  • not_in: does not contain​
  • lk: Matches data that fits a specific pattern.​
  • nlk: Excludes data that fits a specific pattern.​
type​
String​
No​
expression​
The type of the filter condition.​
  • expression: The current condition is an expression.​
  • and: The current condition is a compound expression, and multiple sub-conditions are in an AND logical relationship.​
  • or: The current condition is a compound expression, and multiple sub-conditions are in an OR logical relationship.​
  • map: The current condition is of map type.​
value​
String​
No​
123456​
The filter value.​
values​
Array of String​
No​
[123456]​
The filter value. Multiple filter values are supported.​
map_key​
String​
No​
key_1​
The key of the map type. It is required when the type is set to map.​
dimension​
String​
No​
aid​
The name of the condition.​
sub_conditions​
Array of Condition​
No​
-​
The sub-condition.​
​
Sample request​
​
POST https://apmplus-openapi.cn-beijing.volcengineapi.com?Action=GetAppBatteryTrend&Version=2022-10-12​
{​
"start_time": 1617225600,​
"end_time": 1617312000,​
"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"​
]​
}​
]​
},​
"granularity": 5,​
"metrics": "battery_electric",​
"statistic_scale": "avg",​
"scene": "main_activity"​
}
​
Response parameters​
​
Parameters​
Type​
Sample value​
Description​
data​
Array of TrendLine​
-​
For requests without grouping, the list contains only one element. With grouping enabled, there are multiple elements, each representing a line.​
error_msg​
String​
-​
Error message.​
error_no​
Integer​
0​
Error code.​
​
TrendLine​
​
Parameters​
Type​
Sample value​
Description​
name​
String​
test123​
The name of the line. When grouped, the name needs to be set to the value of the grouping dimension. For example, it is used as the legend label for the curve.​
points​
Array of TrendPoint​
-​
The data points on the curve.​
total​
Double​
​
The total count.​
​
TrendPoint​
​
Parameters​
Type​
Sample value​
Description​
alert​
Object of AlertPoint​
-​
The alert message.​
value​
Double​
123​
The metric value.​
timestamp​
Long​
1665417600​
The time when the metric occurred (Unix timestamp).​
readable_timestamp​
String​
2022-10-11​
The time when the metric occurred (natural time).​
​
AlertPoint​
​
Parameters​
Type​
Sample value​
Description​
msg​
String​
No error​
The alert message.​
alert​
Boolean​
true​
Whether an alert is required.​
​
Sample response​
​
{​
"data": [​
{​
"name": "test123",​
"points": [​
{​
"alert": {​
"alert": "true",​
"msg": "No error"​
},​
"value": 123,​
"timestamp": 1665417600,​
"readable_timestamp": "2022-10-11"​
}​
]​
}​
],​
"error_msg": "",​
"error_no": 0​
}
​
Error codes​
No error codes are specific to this API. If the API call returns an error code, refer to Public error codes for troubleshooting.​
Last updated: 2026.09.16 17:56:13