• Home
Name Date Size #Lines LOC

..--

figures/12-May-2024-

frameworks/12-May-2024-1,227925

interfaces/12-May-2024-428221

sa_profile/12-May-2024-4729

services/12-May-2024-16,32812,211

test/12-May-2024-1,331937

utils/12-May-2024-1,103835

.clang-formatD12-May-20241.3 KiB3836

.gitattributesD12-May-2024798 2019

LICENSED12-May-20249.9 KiB177150

OAT.xmlD12-May-2024982 2610

README.mdD12-May-20243 KiB5940

README_zh.mdD12-May-20242.6 KiB5940

batterystats.gniD12-May-20241.4 KiB2825

batterystats.yamlD12-May-20241.4 KiB3618

bundle.jsonD12-May-20243 KiB8584

README.md

1# Battery Statistics<a name="EN-US_TOPIC_0000001115047353"></a>
2
3-   [Introduction](#section11660541593)
4-   [Directory Structure](#section19472752217)
5-   [Repositories Involved](#section63151229062)
6
7## Introduction<a name="section11660541593"></a>
8
9The battery statistics module provides the following functions:
10
111.  Software power consumption statistics: collects statistics on power consumption of each application or software. The power consumption is measured by Uid. Software power consumption includes but is not limited to the following items: CPU power consumption, running lock power consumption, mobile wireless power consumption, Wi-Fi power consumption, GNSS power consumption, sensor power consumption, camera power consumption, flashlight power consumption, etc.
122.   Hardware power consumption statistics: collects statistics on power consumption of the hardware. Power consumption beyond software power consumption belongs to hardware power consumption. It includes but is not limited to the following items: user power consumption, call power consumption, screen power consumption, Wi-Fi power consumption, and Bluetooth power consumption.
13
14**Figure 1**  Architecture of the battery statistics module<a name="fig106301571239"></a>
15![](figures/power-management-subsystem-architecture.png "Architecture of the battery statistics module")
16
17## Directory Structure<a name="section19472752217"></a>
18
19```
20/base/powermgr/battery_statistics
21├── etc                         # Etc profile
22├── figures                     # Architecture figures
23├── frameworks                  # FrameWork Layer
24│   ├── js                      # NAPI code
25│   └── native                  # Native code
26├── interfaces                  # APIs
27│   ├── innerkits               # Internal APIs
28│   └── kits                    # External APIs
29├── sa_profile                  # SA profile
30├── services                    # Services
31│   ├── native                  # Native services
32│   ├── profile                 # Average Power Consumption Profile
33│   └── zidl                    # Zidl APIs
34├── test                        # Test code
35│   ├── batterystats_fuzzer     # Fuzz test
36│   └── systemtest              # System test
37└── utils                       # Utilities and common code
38```
39
40
41
42## Repositories Involved<a name="section63151229062"></a>
43
44[Power Management Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/power-management.md)
45
46[powermgr_power_manager](https://gitee.com/openharmony/powermgr_power_manager)
47
48[powermgr_display_manager](https://gitee.com/openharmony/powermgr_display_manager)
49
50[powermgr_battery_manager](https://gitee.com/openharmony/powermgr_battery_manager)
51
52[powermgr_thermal_manager](https://gitee.com/openharmony/powermgr_thermal_manager)
53
54**powermgr_battery_statistics**
55
56[powermgr_battery_lite](https://gitee.com/openharmony/powermgr_battery_lite)
57
58[powermgr_powermgr_lite](https://gitee.com/openharmony/powermgr_powermgr_lite)
59

README_zh.md

1# 耗电统计服务组件<a name="ZH-CN_TOPIC_0000001115047353"></a>
2
3-   [简介](#section11660541593)
4-   [目录](#section19472752217)
5-   [相关仓](#section63151229062)
6
7## 简介<a name="section11660541593"></a>
8
9耗电统计组件提供如下功能:
10
111.  软件耗电统计:统计每个应用或者软件的耗电情况,耗电量是以Uid为单位统计;软件功耗的包括不限于下面几项:cpu的耗电、持锁运行带来的耗电、移动无线的耗电 、wifi耗电 、gnss耗电、传感器的耗电 、相机耗电、 闪光灯耗电等。
122.   硬件耗电统计:软件耗电之外的耗电都归属到硬件耗电,包括不限于如下几项:用户功耗 、通话功耗、屏幕功耗 、Wifi功耗 、蓝牙消耗等等。
13
14**图 1**  耗电统计服务组件架构图<a name="fig106301571239"></a>
15![](figures/power-management-subsystem-architecture.png "电源管理子系统架构图")
16
17## 目录<a name="section19472752217"></a>
18
19```
20/base/powermgr/battery_statistics
21├── etc                  		# 启动配置文件
22├── figures                  	# 架构图
23├── frameworks                  # FrameWork层
24│   ├── js                  	# NAPI
25│   └── native                  # Native层
26├── interfaces                  # 接口层
27│   ├── innerkits               # 内部接口
28│   └── kits                    # 外置接口
29├── sa_profile                  # SA 配置文件
30├── services                    # 服务层
31│   ├── native                  # Native 层
32│   ├── profile                 # 平均耗电配置文件
33│   └── zidl                    # Zidl 接口层
34├── test                        # 测试用例
35│   ├── batterystats_fuzzer     # Fuzz测试
36│   └── systemtest              # 系统测试
37└── utils                       # 工具和通用层
38```
39
40
41
42## 相关仓<a name="section63151229062"></a>
43
44[电源管理子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E7%94%B5%E6%BA%90%E7%AE%A1%E7%90%86%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
45
46[powermgr_power_manager](https://gitee.com/openharmony/powermgr_power_manager)
47
48[powermgr_display_manager](https://gitee.com/openharmony/powermgr_display_manager)
49
50[powermgr_battery_manager](https://gitee.com/openharmony/powermgr_battery_manager)
51
52[powermgr_thermal_manager](https://gitee.com/openharmony/powermgr_thermal_manager)
53
54**powermgr_battery_statistics**
55
56[powermgr_battery_lite](https://gitee.com/openharmony/powermgr_battery_lite)
57
58[powermgr_powermgr_lite](https://gitee.com/openharmony/powermgr_powermgr_lite)
59