• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16syntax = "proto3";
17option java_package = "ohos.devtools.datasources.transport.grpc.service";
18option optimize_for = LITE_RUNTIME;
19
20message OptimizeReport {
21  int64 start_time = 1;                 //统计起始时间CLOCK_REALTIME类型
22  int64 end_time = 2;                   //统计结束时间CLOCK_REALTIME类型
23  string bundle_name = 3;               //调优应用包名(AppStatistic/AppDetail/AbnormalEvents必传,其他非必传)
24  uint32 message_type = 4;              //调优消息类型值累加(建议用于二进制位运算,判断是否包含某消息类型)
25  RealBattery real_battery = 5;         //电源信息统计,对应messageType为1(对应原hisysevent中的POWER_IDE_BATTERY上报)
26  AppStatistic app_statistic = 6;       //指定应用的各器件统计信息,对应messageType为2
27  AppDetail app_detail = 7;             //指定应用的各器件调优信息,对应messageType为4
28  ComponentTop component_top = 8;       //整机各器件的top应用信息,对应messageType为8(对应原hisysevent中的POWER_IDE_*上报)
29  AbnormalEvents abnormal_events = 9;   //指定应用的异常事件检测,对应messageType为16(应用异常快速检测,3min/次)
30  ThermalReport thermal_report = 10;    //5.0新增:热温度信息,对应messageType为32
31  int64 start_time_b = 11;              //5.0新增:统计起始时间CLOCK_BOOTTIME类型
32  int64 end_time_b = 12;                //5.0新增:统计结束时间CLOCK_BOOTTIME类型
33}
34
35message RealBattery {
36  int64 capacity = 1;   //电池容量
37  int64 charge = 2;     //充电状态
38  int64 current = 3;    //电池电流,计划日落,用real_current替代
39  int64 gas_gauge = 4;  //电池电量
40  int64 level = 5;      //电池百分比
41  int64 screen = 6;     //屏幕状态
42  repeated int32 real_current = 7;   //5.0新增:实时电流,100ms采集一次
43}
44
45message AppStatistic {
46  AppStatisticCommon audio = 1;       //指定应用的audio统计信息
47  AppStatisticCommon bluetooth = 2;   //指定应用的bluetooth统计信息
48  AppStatisticCommon camera = 3;      //指定应用的camera统计信息
49  AppStatisticCommon cpu = 4;         //指定应用的cpu统计信息
50  AppStatisticCommon display = 5;     //指定应用的display统计信息
51  AppStatisticCommon flashlight = 6;  //指定应用的flashlight统计信息
52  AppStatisticCommon gpu = 7;         //指定应用的gpu统计信息
53  AppStatisticCommon location = 8;    //指定应用的location统计信息
54  AppStatisticCommon wifiscan = 9;    //指定应用的wifiscan统计信息
55  AppStatisticCommon wifi = 10;       //5.0新增:指定应用的wifi流量统计信息
56  AppStatisticCommon modem = 11;      //5.0新增:指定应用的modem流量统计信息
57}
58
59message AppStatisticCommon {
60  int64 energy = 1;   //器件统计功耗
61  int64 time = 2;     //器件使用时长
62}
63
64message AppDetail {
65  AppDetailCPU cpu = 1;         //指定应用的cpu调优信息
66  AppDetailGPU gpu = 2;         //指定应用的gpu调优信息
67  AppDetailWifi wifi = 3;       //指定应用的wifi调优信息
68  AppDetailDisplay display = 4; //指定应用的display调优信息
69}
70
71message AppDetailCPU {
72  int32 thread_count = 1;           //指定应用的线程数
73  repeated int64 thread_load = 2;   //各线程负载
74  repeated string thread_name = 3;  //各线程名
75  repeated int64 thread_time = 4;   //各线程执行时长
76  repeated int64 thread_energy = 5; //各线程统计功耗
77}
78
79message AppDetailGPU {
80  int64 frequency_count = 1;    //GPU运行的频率数
81  repeated int64 frequency = 2; //GPU运行的频率
82  repeated int64 idle_time = 3; //对应频率的idea时长
83  repeated int64 run_time = 4;  //对应频率的运行时长
84}
85
86message AppDetailWifi {
87  int64 tx_packets = 1;   //wifi传输数据包
88  int64 rx_packets = 2;   //wifi接受数据包
89  int64 tx_bytes = 3;     //wifi传输字节数
90  int64 rx_bytes = 4;     //wifi接受字节数
91}
92
93message AppDetailDisplay {
94  int64 count_1hz = 1;      //刷新率在每秒1次的驻留时长
95  int64 count_5hz = 2;      //刷新率在每秒5次的驻留时长
96  int64 count_10hz = 3;     //刷新率在每秒10次的驻留时长
97  int64 count_15hz = 4;     //刷新率在每秒15次的驻留时长
98  int64 count_24hz = 5;     //刷新率在每秒24次的驻留时长
99  int64 count_30hz = 6;     //刷新率在每秒30次的驻留时长
100  int64 count_45hz = 7;     //刷新率在每秒45次的驻留时长
101  int64 count_60hz = 8;     //刷新率在每秒60次的驻留时长
102  int64 count_90hz = 9;     //刷新率在每秒90次的驻留时长
103  int64 count_120hz = 10;   //刷新率在每秒120次的驻留时长
104  int64 count_180hz = 11;   //刷新率在每秒180次的驻留时长
105}
106
107message ComponentTop {
108  ComponentTopCommon audio = 1;       //整机audio的top应用信息
109  ComponentTopCommon bluetooth = 2;   //整机bluetooth的top应用信息
110  ComponentTopCamera camera = 3;      //整机camera的top应用信息
111  ComponentTopCpu cpu = 4;            //整机cpu的top应用信息
112  ComponentTopDisplay display = 5;    //整机display的top应用信息
113  ComponentTopCommon flashlight = 6;  //整机flashlight的top应用信息
114  ComponentTopDisplay gpu = 7;        //整机gpu的top应用信息
115  ComponentTopCommon location = 8;    //整机location的top应用信息
116  ComponentTopCommon wifiscan = 9;    //整机wifiscan的top应用信息
117}
118
119message ComponentTopCommon {
120  int32 count = 1;                        //应用个数
121  repeated string appname = 2;            //应用包名
122  repeated int64 background_duration = 3; //后台使用时长
123  repeated int64 background_energy = 4;   //后台使用功耗值
124  repeated int64 foreground_duration = 5; //前台使用时长
125  repeated int64 foreground_energy = 6;   //前台使用功耗值
126  repeated int64 screen_off_duration = 7; //灭屏使用时长
127  repeated int64 screen_off_energy = 8;   //灭屏使用功耗值
128  repeated int64 screen_on_duration = 9;  //亮屏使用时长
129  repeated int64 screen_on_energy = 10;   //亮屏使用功耗值
130}
131
132message ComponentTopCamera {
133  int32 count = 1;                        //应用个数
134  repeated string appname = 2;            //应用包名
135  repeated int64 camera_id = 3;           //Camera类型,0:后置,1:前置
136  repeated int64 background_duration = 4; //后台使用时长
137  repeated int64 background_energy = 5;   //后台使用功耗值
138  repeated int64 foreground_duration = 6; //前台使用时长
139  repeated int64 foreground_energy = 7;   //前台使用功耗值
140  repeated int64 screen_off_duration = 8; //灭屏使用时长
141  repeated int64 screen_off_energy = 9;   //灭屏使用功耗值
142  repeated int64 screen_on_duration = 10; //亮屏使用时长
143  repeated int64 screen_on_energy = 11;   //亮屏使用功耗值
144}
145
146message ComponentTopCpu {
147  int32 count = 1;                        //应用个数
148  repeated string appname = 2;            //应用包名
149  repeated int64 uid = 3;                 //应用UID
150  repeated int64 background_duration = 4; //后台使用时长
151  repeated int64 background_energy = 5;   //后台使用功耗值
152  repeated int64 foreground_duration = 6; //前台使用时长
153  repeated int64 foreground_energy = 7;   //前台使用功耗值
154  repeated int64 screen_off_duration = 8; //灭屏使用时长
155  repeated int64 screen_off_energy = 9;   //灭屏使用功耗值
156  repeated int64 screen_on_duration = 10; //亮屏使用时长
157  repeated int64 screen_on_energy = 11;   //亮屏使用功耗值
158  repeated int64 load = 12;               //cpu占用率
159}
160
161message ComponentTopDisplay {
162  int32 count = 1;              //应用个数
163  repeated string appname = 2;  //应用包名
164  repeated int64 time = 3;      //应用使用时长
165  repeated int64 energy = 4;    //应用功耗值
166}
167
168message AbnormalEvents {
169  int64 anomaly_start_time = 1;             //异常检测起始时间
170  int64 anomaly_end_time = 2;               //异常检测结束时间
171  int32 count = 3;                          //检测到当前应用的异常数
172  repeated AbnormalEventInfo events = 4;    //各类异常详情数组
173}
174
175message AbnormalEventInfo {
176  enum AbnormalType {
177    CPU_BG_HEAVY_LOAD = 0;        //cpu后台高负载异常
178    CPU_FG_HEAVY_LOAD = 1;        //cpu前台高负载异常
179    CPU_HIGH_FREQUENCY = 2;       //cpu高频异常
180    GNSS_ENERGY = 3;              //Gnss高耗电异常
181    LOCATION_COUNTER = 4;         //频繁定位异常
182    WIFI_ENERGY = 5;              //Wifi高耗电异常
183  }
184  AbnormalType abnormal_type = 1;  //异常类型
185  int64 usage_time = 2;           //使用时长
186  int64 usage_energy = 3;         //使用功耗
187  int64 usage_load = 4;           //使用负载
188  int64 usage_freq = 5;           //使用频率
189  int32 usage_count = 6;          //使用次数
190}
191
192message ThermalReport {           //热温度信息
193  int64 shell_temp = 1;           //外壳温度
194  int64 thermal_level = 2;        //温度等级
195}