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"; |
| 18 | |
| 19 | package android.os.statsd; |
| 20 | |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 21 | option java_package = "com.android.os"; |
| 22 | option java_outer_classname = "StatsLog"; |
| 23 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 24 | import "frameworks/base/cmds/statsd/src/atoms.proto"; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 25 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 26 | message DimensionsValue { |
| 27 | optional int32 field = 1; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 28 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 29 | oneof value { |
| 30 | string value_str = 2; |
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 31 | int32 value_int = 3; |
| 32 | int64 value_long = 4; |
| 33 | bool value_bool = 5; |
| 34 | float value_float = 6; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 35 | DimensionsValueTuple value_tuple = 7; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 36 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 37 | } |
| 38 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 39 | message DimensionsValueTuple { |
| 40 | repeated DimensionsValue dimensions_value = 1; |
| 41 | } |
| 42 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 43 | message EventMetricData { |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 44 | optional int64 elapsed_timestamp_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 45 | |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 46 | optional Atom atom = 2; |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 47 | |
Yangster-mac | 3fa5d7f | 2018-03-10 21:50:27 -0800 | [diff] [blame] | 48 | optional int64 wall_clock_timestamp_nanos = 3; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | message CountBucketInfo { |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 52 | optional int64 start_bucket_elapsed_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 53 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 54 | optional int64 end_bucket_elapsed_nanos = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 55 | |
| 56 | optional int64 count = 3; |
| 57 | } |
| 58 | |
| 59 | message CountMetricData { |
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 60 | optional DimensionsValue dimensions_in_what = 1; |
| 61 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 62 | optional DimensionsValue dimensions_in_condition = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 63 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 64 | repeated CountBucketInfo bucket_info = 3; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 65 | } |
| 66 | |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 67 | message DurationBucketInfo { |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 68 | optional int64 start_bucket_elapsed_nanos = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 69 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 70 | optional int64 end_bucket_elapsed_nanos = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 71 | |
| 72 | optional int64 duration_nanos = 3; |
| 73 | } |
| 74 | |
| 75 | message DurationMetricData { |
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 76 | optional DimensionsValue dimensions_in_what = 1; |
| 77 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 78 | optional DimensionsValue dimensions_in_condition = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 79 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 80 | repeated DurationBucketInfo bucket_info = 3; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 81 | } |
| 82 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 83 | message ValueBucketInfo { |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 84 | optional int64 start_bucket_elapsed_nanos = 1; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 85 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 86 | optional int64 end_bucket_elapsed_nanos = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 87 | |
| 88 | optional int64 value = 3; |
| 89 | } |
| 90 | |
| 91 | message ValueMetricData { |
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 92 | optional DimensionsValue dimensions_in_what = 1; |
| 93 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 94 | optional DimensionsValue dimensions_in_condition = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 95 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 96 | repeated ValueBucketInfo bucket_info = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | message GaugeBucketInfo { |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame^] | 100 | optional int64 start_bucket_elapsed_nanos = 1; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 101 | |
Yangster-mac | 15f6bbc | 2018-04-08 11:52:26 -0700 | [diff] [blame^] | 102 | optional int64 end_bucket_elapsed_nanos = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 103 | |
Yangster-mac | 34ea110 | 2018-01-29 12:40:55 -0800 | [diff] [blame] | 104 | repeated Atom atom = 3; |
| 105 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 106 | repeated int64 elapsed_timestamp_nanos = 4; |
Yangster-mac | 3fa5d7f | 2018-03-10 21:50:27 -0800 | [diff] [blame] | 107 | |
| 108 | repeated int64 wall_clock_timestamp_nanos = 5; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | message GaugeMetricData { |
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 112 | optional DimensionsValue dimensions_in_what = 1; |
| 113 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 114 | optional DimensionsValue dimensions_in_condition = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 115 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 116 | repeated GaugeBucketInfo bucket_info = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 117 | } |
| 118 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 119 | message StatsLogReport { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 120 | optional int64 metric_id = 1; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 121 | |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 122 | // Fields 2 and 3 are reserved. |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 123 | |
| 124 | message EventMetricDataWrapper { |
| 125 | repeated EventMetricData data = 1; |
| 126 | } |
| 127 | message CountMetricDataWrapper { |
| 128 | repeated CountMetricData data = 1; |
| 129 | } |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 130 | message DurationMetricDataWrapper { |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 131 | repeated DurationMetricData data = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 132 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 133 | message ValueMetricDataWrapper { |
| 134 | repeated ValueMetricData data = 1; |
| 135 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 136 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 137 | message GaugeMetricDataWrapper { |
| 138 | repeated GaugeMetricData data = 1; |
| 139 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 140 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 141 | oneof data { |
| 142 | EventMetricDataWrapper event_metrics = 4; |
| 143 | CountMetricDataWrapper count_metrics = 5; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 144 | DurationMetricDataWrapper duration_metrics = 6; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 145 | ValueMetricDataWrapper value_metrics = 7; |
| 146 | GaugeMetricDataWrapper gauge_metrics = 8; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 147 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 148 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 149 | |
David Chen | f384b90 | 2018-03-14 18:36:45 -0700 | [diff] [blame] | 150 | message UidMapping { |
| 151 | message PackageInfoSnapshot { |
| 152 | message PackageInfo { |
| 153 | optional string name = 1; |
| 154 | |
| 155 | optional int64 version = 2; |
| 156 | |
| 157 | optional int32 uid = 3; |
David Chen | bd12527 | 2018-04-04 19:02:50 -0700 | [diff] [blame] | 158 | |
| 159 | optional bool deleted = 4; |
David Chen | f384b90 | 2018-03-14 18:36:45 -0700 | [diff] [blame] | 160 | } |
| 161 | optional int64 elapsed_timestamp_nanos = 1; |
| 162 | |
| 163 | repeated PackageInfo package_info = 2; |
| 164 | } |
| 165 | repeated PackageInfoSnapshot snapshots = 1; |
| 166 | |
| 167 | message Change { |
| 168 | optional bool deletion = 1; |
| 169 | |
| 170 | optional int64 elapsed_timestamp_nanos = 2; |
| 171 | optional string app = 3; |
| 172 | optional int32 uid = 4; |
| 173 | |
David Chen | bd12527 | 2018-04-04 19:02:50 -0700 | [diff] [blame] | 174 | optional int64 new_version = 5; |
| 175 | optional int64 prev_version = 6; |
David Chen | f384b90 | 2018-03-14 18:36:45 -0700 | [diff] [blame] | 176 | } |
| 177 | repeated Change changes = 2; |
| 178 | } |
| 179 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 180 | message ConfigMetricsReport { |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 181 | repeated StatsLogReport metrics = 1; |
| 182 | |
| 183 | optional UidMapping uid_map = 2; |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 184 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 185 | optional int64 last_report_elapsed_nanos = 3; |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 186 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 187 | optional int64 current_report_elapsed_nanos = 4; |
Yangster-mac | 3fa5d7f | 2018-03-10 21:50:27 -0800 | [diff] [blame] | 188 | |
| 189 | optional int64 last_report_wall_clock_nanos = 5; |
| 190 | |
| 191 | optional int64 current_report_wall_clock_nanos = 6; |
David Chen | faa1af5 | 2018-03-30 15:14:04 -0700 | [diff] [blame] | 192 | |
| 193 | message Annotation { |
| 194 | optional int64 field_int64 = 1; |
| 195 | optional int32 field_int32 = 2; |
| 196 | } |
| 197 | repeated Annotation annotation = 7; |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | message ConfigMetricsReportList { |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 201 | message ConfigKey { |
| 202 | optional int32 uid = 1; |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 203 | optional int64 id = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 204 | } |
| 205 | optional ConfigKey config_key = 1; |
| 206 | |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 207 | repeated ConfigMetricsReport reports = 2; |
Yangster-mac | 932ecec | 2018-02-01 10:23:52 -0800 | [diff] [blame] | 208 | } |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 209 | |
| 210 | message StatsdStatsReport { |
| 211 | optional int32 stats_begin_time_sec = 1; |
| 212 | |
| 213 | optional int32 stats_end_time_sec = 2; |
| 214 | |
| 215 | message MatcherStats { |
| 216 | optional int64 id = 1; |
| 217 | optional int32 matched_times = 2; |
| 218 | } |
| 219 | |
| 220 | message ConditionStats { |
| 221 | optional int64 id = 1; |
| 222 | optional int32 max_tuple_counts = 2; |
| 223 | } |
| 224 | |
| 225 | message MetricStats { |
| 226 | optional int64 id = 1; |
| 227 | optional int32 max_tuple_counts = 2; |
| 228 | } |
| 229 | |
| 230 | message AlertStats { |
| 231 | optional int64 id = 1; |
| 232 | optional int32 alerted_times = 2; |
| 233 | } |
| 234 | |
| 235 | message ConfigStats { |
| 236 | optional int32 uid = 1; |
| 237 | optional int64 id = 2; |
| 238 | optional int32 creation_time_sec = 3; |
| 239 | optional int32 deletion_time_sec = 4; |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 240 | optional int32 reset_time_sec = 19; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 241 | optional int32 metric_count = 5; |
| 242 | optional int32 condition_count = 6; |
| 243 | optional int32 matcher_count = 7; |
| 244 | optional int32 alert_count = 8; |
| 245 | optional bool is_valid = 9; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 246 | repeated int32 broadcast_sent_time_sec = 10; |
| 247 | repeated int32 data_drop_time_sec = 11; |
| 248 | repeated int32 dump_report_time_sec = 12; |
Yangster-mac | e68f3a5 | 2018-04-04 00:01:43 -0700 | [diff] [blame] | 249 | repeated int32 dump_report_data_size = 20; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 250 | repeated MatcherStats matcher_stats = 13; |
| 251 | repeated ConditionStats condition_stats = 14; |
| 252 | repeated MetricStats metric_stats = 15; |
| 253 | repeated AlertStats alert_stats = 16; |
Yangster-mac | 306ccc2 | 2018-03-24 15:03:40 -0700 | [diff] [blame] | 254 | repeated MetricStats metric_dimension_in_condition_stats = 17; |
David Chen | faa1af5 | 2018-03-30 15:14:04 -0700 | [diff] [blame] | 255 | message Annotation { |
| 256 | optional int64 field_int64 = 1; |
| 257 | optional int32 field_int32 = 2; |
| 258 | } |
| 259 | repeated Annotation annotation = 18; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | repeated ConfigStats config_stats = 3; |
| 263 | |
| 264 | message AtomStats { |
| 265 | optional int32 tag = 1; |
| 266 | optional int32 count = 2; |
| 267 | } |
| 268 | |
| 269 | repeated AtomStats atom_stats = 7; |
| 270 | |
| 271 | message UidMapStats { |
David Chen | bd12527 | 2018-04-04 19:02:50 -0700 | [diff] [blame] | 272 | optional int32 changes = 1; |
| 273 | optional int32 bytes_used = 2; |
| 274 | optional int32 dropped_changes = 3; |
| 275 | optional int32 deleted_apps = 4; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 276 | } |
| 277 | optional UidMapStats uidmap_stats = 8; |
| 278 | |
| 279 | message AnomalyAlarmStats { |
| 280 | optional int32 alarms_registered = 1; |
| 281 | } |
| 282 | optional AnomalyAlarmStats anomaly_alarm_stats = 9; |
| 283 | |
| 284 | message PulledAtomStats { |
| 285 | optional int32 atom_id = 1; |
| 286 | optional int64 total_pull = 2; |
| 287 | optional int64 total_pull_from_cache = 3; |
| 288 | optional int64 min_pull_interval_sec = 4; |
| 289 | } |
| 290 | repeated PulledAtomStats pulled_atom_stats = 10; |
| 291 | |
| 292 | message LoggerErrorStats { |
| 293 | optional int32 logger_disconnection_sec = 1; |
| 294 | optional int32 error_code = 2; |
| 295 | } |
| 296 | repeated LoggerErrorStats logger_error_stats = 11; |
Yangster-mac | b8382a1 | 2018-04-04 10:39:12 -0700 | [diff] [blame] | 297 | |
| 298 | message PeriodicAlarmStats { |
| 299 | optional int32 alarms_registered = 1; |
| 300 | } |
| 301 | optional PeriodicAlarmStats periodic_alarm_stats = 12; |
| 302 | |
| 303 | message SkippedLogEventStats { |
| 304 | optional int32 tag = 1; |
| 305 | optional int64 elapsed_timestamp_nanos = 2; |
| 306 | } |
| 307 | repeated SkippedLogEventStats skipped_log_event_stats = 13; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 308 | } |