Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 1 | /* |
2 | * Copyright (C) 2017 The Android Open Source Project | ||||
3 | * | ||||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
5 | * you may not use this file except in compliance with the License. | ||||
6 | * You may obtain a copy of the License at | ||||
7 | * | ||||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
9 | * | ||||
10 | * Unless required by applicable law or agreed to in writing, software | ||||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
13 | * See the License for the specific language governing permissions and | ||||
14 | * limitations under the License. | ||||
15 | */ | ||||
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 16 | |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 17 | syntax = "proto2"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 18 | option optimize_for = LITE_RUNTIME; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 19 | |
20 | package android.os.statsd; | ||||
21 | |||||
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 22 | option java_package = "com.android.os"; |
23 | option java_outer_classname = "StatsLog"; | ||||
24 | |||||
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 25 | import "frameworks/base/cmds/statsd/src/atoms.proto"; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 26 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 27 | message DimensionsValue { |
28 | optional int32 field = 1; | ||||
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 29 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 30 | oneof value { |
31 | string value_str = 2; | ||||
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 32 | int32 value_int = 3; |
33 | int64 value_long = 4; | ||||
34 | bool value_bool = 5; | ||||
35 | float value_float = 6; | ||||
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 36 | DimensionsValueTuple value_tuple = 7; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 37 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 38 | } |
39 | |||||
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 40 | message DimensionsValueTuple { |
41 | repeated DimensionsValue dimensions_value = 1; | ||||
42 | } | ||||
43 | |||||
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 44 | message EventMetricData { |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 45 | optional int64 timestamp_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 46 | |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 47 | optional Atom atom = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 48 | } |
49 | |||||
50 | message CountBucketInfo { | ||||
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 51 | optional int64 start_bucket_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 52 | |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 53 | optional int64 end_bucket_nanos = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 54 | |
55 | optional int64 count = 3; | ||||
56 | } | ||||
57 | |||||
58 | message CountMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 59 | optional DimensionsValue dimensions_in_what = 1; |
60 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 61 | optional DimensionsValue dimensions_in_condition = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 62 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 63 | repeated CountBucketInfo bucket_info = 3; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 64 | } |
65 | |||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 66 | message DurationBucketInfo { |
67 | optional int64 start_bucket_nanos = 1; | ||||
68 | |||||
69 | optional int64 end_bucket_nanos = 2; | ||||
70 | |||||
71 | optional int64 duration_nanos = 3; | ||||
72 | } | ||||
73 | |||||
74 | message DurationMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 75 | optional DimensionsValue dimensions_in_what = 1; |
76 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 77 | optional DimensionsValue dimensions_in_condition = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 78 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 79 | repeated DurationBucketInfo bucket_info = 3; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 80 | } |
81 | |||||
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 82 | message ValueBucketInfo { |
83 | optional int64 start_bucket_nanos = 1; | ||||
84 | |||||
85 | optional int64 end_bucket_nanos = 2; | ||||
86 | |||||
87 | optional int64 value = 3; | ||||
88 | } | ||||
89 | |||||
90 | message ValueMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 91 | optional DimensionsValue dimensions_in_what = 1; |
92 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 93 | optional DimensionsValue dimensions_in_condition = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 94 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 95 | repeated ValueBucketInfo bucket_info = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 96 | } |
97 | |||||
98 | message GaugeBucketInfo { | ||||
99 | optional int64 start_bucket_nanos = 1; | ||||
100 | |||||
101 | optional int64 end_bucket_nanos = 2; | ||||
102 | |||||
Yangster-mac | 34ea110 | 2018-01-29 12:40:55 -0800 | [diff] [blame] | 103 | repeated Atom atom = 3; |
104 | |||||
105 | repeated int64 timestamp_nanos = 4; | ||||
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 106 | } |
107 | |||||
108 | message GaugeMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 109 | optional DimensionsValue dimensions_in_what = 1; |
110 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 111 | optional DimensionsValue dimensions_in_condition = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 112 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 113 | repeated GaugeBucketInfo bucket_info = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 114 | } |
115 | |||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 116 | message UidMapping { |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 117 | message PackageInfoSnapshot { |
118 | message PackageInfo { | ||||
119 | optional string name = 1; | ||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 120 | |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 121 | optional int64 version = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 122 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 123 | optional int32 uid = 3; |
124 | } | ||||
125 | optional int64 timestamp_nanos = 1; | ||||
126 | |||||
127 | repeated PackageInfo package_info = 2; | ||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 128 | } |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 129 | repeated PackageInfoSnapshot snapshots = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 130 | |
131 | message Change { | ||||
132 | optional bool deletion = 1; | ||||
133 | |||||
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 134 | optional int64 timestamp_nanos = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 135 | optional string app = 3; |
136 | optional int32 uid = 4; | ||||
137 | |||||
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 138 | optional int64 version = 5; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 139 | } |
140 | repeated Change changes = 2; | ||||
141 | } | ||||
142 | |||||
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 143 | message StatsLogReport { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 144 | optional int64 metric_id = 1; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 145 | |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 146 | // Fields 2 and 3 are reserved. |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 147 | |
148 | message EventMetricDataWrapper { | ||||
149 | repeated EventMetricData data = 1; | ||||
150 | } | ||||
151 | message CountMetricDataWrapper { | ||||
152 | repeated CountMetricData data = 1; | ||||
153 | } | ||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 154 | message DurationMetricDataWrapper { |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 155 | repeated DurationMetricData data = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 156 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 157 | message ValueMetricDataWrapper { |
158 | repeated ValueMetricData data = 1; | ||||
159 | } | ||||
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 160 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 161 | message GaugeMetricDataWrapper { |
162 | repeated GaugeMetricData data = 1; | ||||
163 | } | ||||
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 164 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 165 | oneof data { |
166 | EventMetricDataWrapper event_metrics = 4; | ||||
167 | CountMetricDataWrapper count_metrics = 5; | ||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 168 | DurationMetricDataWrapper duration_metrics = 6; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 169 | ValueMetricDataWrapper value_metrics = 7; |
170 | GaugeMetricDataWrapper gauge_metrics = 8; | ||||
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 171 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 172 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 173 | |
174 | message ConfigMetricsReport { | ||||
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 175 | repeated StatsLogReport metrics = 1; |
176 | |||||
177 | optional UidMapping uid_map = 2; | ||||
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 178 | |
179 | optional int64 last_report_nanos = 3; | ||||
180 | |||||
181 | optional int64 current_report_nanos = 4; | ||||
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 182 | } |
183 | |||||
184 | message ConfigMetricsReportList { | ||||
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 185 | message ConfigKey { |
186 | optional int32 uid = 1; | ||||
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 187 | optional int64 id = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 188 | } |
189 | optional ConfigKey config_key = 1; | ||||
190 | |||||
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 191 | repeated ConfigMetricsReport reports = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 192 | } |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 193 | |
194 | message StatsdStatsReport { | ||||
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 195 | optional int32 stats_begin_time_sec = 1; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 196 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 197 | optional int32 stats_end_time_sec = 2; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 198 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 199 | message MatcherStats { |
200 | optional int64 id = 1; | ||||
201 | optional int32 matched_times = 2; | ||||
202 | } | ||||
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 203 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 204 | message ConditionStats { |
205 | optional int64 id = 1; | ||||
206 | optional int32 max_tuple_counts = 2; | ||||
207 | } | ||||
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 208 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 209 | message MetricStats { |
210 | optional int64 id = 1; | ||||
211 | optional int32 max_tuple_counts = 2; | ||||
212 | } | ||||
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 213 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 214 | message AlertStats { |
215 | optional int64 id = 1; | ||||
216 | optional int32 alerted_times = 2; | ||||
217 | } | ||||
Bookatz | 8f2f3d8 | 2017-12-07 13:53:21 -0800 | [diff] [blame] | 218 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 219 | message ConfigStats { |
220 | optional int32 uid = 1; | ||||
221 | optional int64 id = 2; | ||||
222 | optional int32 creation_time_sec = 3; | ||||
223 | optional int32 deletion_time_sec = 4; | ||||
224 | optional int32 metric_count = 5; | ||||
225 | optional int32 condition_count = 6; | ||||
226 | optional int32 matcher_count = 7; | ||||
227 | optional int32 alert_count = 8; | ||||
228 | optional bool is_valid = 9; | ||||
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 229 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 230 | repeated int32 broadcast_sent_time_sec = 10; |
231 | repeated int32 data_drop_time_sec = 11; | ||||
232 | repeated int32 dump_report_time_sec = 12; | ||||
233 | repeated MatcherStats matcher_stats = 13; | ||||
234 | repeated ConditionStats condition_stats = 14; | ||||
235 | repeated MetricStats metric_stats = 15; | ||||
236 | repeated AlertStats alert_stats = 16; | ||||
237 | } | ||||
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 238 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 239 | repeated ConfigStats config_stats = 3; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 240 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 241 | message AtomStats { |
242 | optional int32 tag = 1; | ||||
243 | optional int32 count = 2; | ||||
244 | } | ||||
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 245 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 246 | repeated AtomStats atom_stats = 7; |
David Chen | c136f45 | 2017-11-27 11:52:26 -0800 | [diff] [blame] | 247 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 248 | message UidMapStats { |
249 | optional int32 snapshots = 1; | ||||
250 | optional int32 changes = 2; | ||||
251 | optional int32 bytes_used = 3; | ||||
252 | optional int32 dropped_snapshots = 4; | ||||
253 | optional int32 dropped_changes = 5; | ||||
254 | } | ||||
255 | optional UidMapStats uidmap_stats = 8; | ||||
Bookatz | 1d0136d | 2017-12-01 11:13:32 -0800 | [diff] [blame] | 256 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 257 | message AnomalyAlarmStats { |
258 | optional int32 alarms_registered = 1; | ||||
259 | } | ||||
260 | optional AnomalyAlarmStats anomaly_alarm_stats = 9; | ||||
Chenjie Yu | b038b70 | 2017-12-18 15:15:34 -0800 | [diff] [blame] | 261 | |
Yangster | b84e8b1 | 2018-01-22 16:18:34 -0800 | [diff] [blame] | 262 | message PulledAtomStats { |
263 | optional int32 atom_id = 1; | ||||
264 | optional int64 total_pull = 2; | ||||
265 | optional int64 total_pull_from_cache = 3; | ||||
266 | optional int64 min_pull_interval_sec = 4; | ||||
267 | } | ||||
268 | repeated PulledAtomStats pulled_atom_stats = 10; | ||||
Yao Chen | 884c8c1 | 2018-01-26 10:36:25 -0800 | [diff] [blame] | 269 | |
270 | message LoggerErrorStats { | ||||
271 | optional int32 logger_disconnection_sec = 1; | ||||
272 | optional int32 error_code = 2; | ||||
273 | } | ||||
274 | repeated LoggerErrorStats logger_error_stats = 11; | ||||
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 275 | } |