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 | |
David Chen | 81245fd | 2018-04-12 14:33:37 -0700 | [diff] [blame^] | 124 | message SkippedBuckets { |
| 125 | optional int64 start_elapsed_nanos = 1; |
| 126 | optional int64 end_elapsed_nanos = 2; |
| 127 | } |
| 128 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 129 | message EventMetricDataWrapper { |
| 130 | repeated EventMetricData data = 1; |
| 131 | } |
| 132 | message CountMetricDataWrapper { |
| 133 | repeated CountMetricData data = 1; |
| 134 | } |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 135 | message DurationMetricDataWrapper { |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 136 | repeated DurationMetricData data = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 137 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 138 | message ValueMetricDataWrapper { |
| 139 | repeated ValueMetricData data = 1; |
David Chen | 81245fd | 2018-04-12 14:33:37 -0700 | [diff] [blame^] | 140 | repeated SkippedBuckets skipped = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 141 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 142 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 143 | message GaugeMetricDataWrapper { |
| 144 | repeated GaugeMetricData data = 1; |
David Chen | 81245fd | 2018-04-12 14:33:37 -0700 | [diff] [blame^] | 145 | repeated SkippedBuckets skipped = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 146 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 147 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 148 | oneof data { |
| 149 | EventMetricDataWrapper event_metrics = 4; |
| 150 | CountMetricDataWrapper count_metrics = 5; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 151 | DurationMetricDataWrapper duration_metrics = 6; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 152 | ValueMetricDataWrapper value_metrics = 7; |
| 153 | GaugeMetricDataWrapper gauge_metrics = 8; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 154 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 155 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 156 | |
David Chen | f384b90 | 2018-03-14 18:36:45 -0700 | [diff] [blame] | 157 | message UidMapping { |
| 158 | message PackageInfoSnapshot { |
| 159 | message PackageInfo { |
| 160 | optional string name = 1; |
| 161 | |
| 162 | optional int64 version = 2; |
| 163 | |
| 164 | optional int32 uid = 3; |
David Chen | bd12527 | 2018-04-04 19:02:50 -0700 | [diff] [blame] | 165 | |
| 166 | optional bool deleted = 4; |
David Chen | f384b90 | 2018-03-14 18:36:45 -0700 | [diff] [blame] | 167 | } |
| 168 | optional int64 elapsed_timestamp_nanos = 1; |
| 169 | |
| 170 | repeated PackageInfo package_info = 2; |
| 171 | } |
| 172 | repeated PackageInfoSnapshot snapshots = 1; |
| 173 | |
| 174 | message Change { |
| 175 | optional bool deletion = 1; |
| 176 | |
| 177 | optional int64 elapsed_timestamp_nanos = 2; |
| 178 | optional string app = 3; |
| 179 | optional int32 uid = 4; |
| 180 | |
David Chen | bd12527 | 2018-04-04 19:02:50 -0700 | [diff] [blame] | 181 | optional int64 new_version = 5; |
| 182 | optional int64 prev_version = 6; |
David Chen | f384b90 | 2018-03-14 18:36:45 -0700 | [diff] [blame] | 183 | } |
| 184 | repeated Change changes = 2; |
| 185 | } |
| 186 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 187 | message ConfigMetricsReport { |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 188 | repeated StatsLogReport metrics = 1; |
| 189 | |
| 190 | optional UidMapping uid_map = 2; |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 191 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 192 | optional int64 last_report_elapsed_nanos = 3; |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 193 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 194 | optional int64 current_report_elapsed_nanos = 4; |
Yangster-mac | 3fa5d7f | 2018-03-10 21:50:27 -0800 | [diff] [blame] | 195 | |
| 196 | optional int64 last_report_wall_clock_nanos = 5; |
| 197 | |
| 198 | optional int64 current_report_wall_clock_nanos = 6; |
David Chen | faa1af5 | 2018-03-30 15:14:04 -0700 | [diff] [blame] | 199 | |
| 200 | message Annotation { |
| 201 | optional int64 field_int64 = 1; |
| 202 | optional int32 field_int32 = 2; |
| 203 | } |
| 204 | repeated Annotation annotation = 7; |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | message ConfigMetricsReportList { |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 208 | message ConfigKey { |
| 209 | optional int32 uid = 1; |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 210 | optional int64 id = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 211 | } |
| 212 | optional ConfigKey config_key = 1; |
| 213 | |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 214 | repeated ConfigMetricsReport reports = 2; |
Yangster-mac | 932ecec | 2018-02-01 10:23:52 -0800 | [diff] [blame] | 215 | } |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 216 | |
| 217 | message StatsdStatsReport { |
| 218 | optional int32 stats_begin_time_sec = 1; |
| 219 | |
| 220 | optional int32 stats_end_time_sec = 2; |
| 221 | |
| 222 | message MatcherStats { |
| 223 | optional int64 id = 1; |
| 224 | optional int32 matched_times = 2; |
| 225 | } |
| 226 | |
| 227 | message ConditionStats { |
| 228 | optional int64 id = 1; |
| 229 | optional int32 max_tuple_counts = 2; |
| 230 | } |
| 231 | |
| 232 | message MetricStats { |
| 233 | optional int64 id = 1; |
| 234 | optional int32 max_tuple_counts = 2; |
| 235 | } |
| 236 | |
| 237 | message AlertStats { |
| 238 | optional int64 id = 1; |
| 239 | optional int32 alerted_times = 2; |
| 240 | } |
| 241 | |
| 242 | message ConfigStats { |
| 243 | optional int32 uid = 1; |
| 244 | optional int64 id = 2; |
| 245 | optional int32 creation_time_sec = 3; |
| 246 | optional int32 deletion_time_sec = 4; |
Yangster-mac | b142cc8 | 2018-03-30 15:22:08 -0700 | [diff] [blame] | 247 | optional int32 reset_time_sec = 19; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 248 | optional int32 metric_count = 5; |
| 249 | optional int32 condition_count = 6; |
| 250 | optional int32 matcher_count = 7; |
| 251 | optional int32 alert_count = 8; |
| 252 | optional bool is_valid = 9; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 253 | repeated int32 broadcast_sent_time_sec = 10; |
| 254 | repeated int32 data_drop_time_sec = 11; |
| 255 | repeated int32 dump_report_time_sec = 12; |
Yangster-mac | e68f3a5 | 2018-04-04 00:01:43 -0700 | [diff] [blame] | 256 | repeated int32 dump_report_data_size = 20; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 257 | repeated MatcherStats matcher_stats = 13; |
| 258 | repeated ConditionStats condition_stats = 14; |
| 259 | repeated MetricStats metric_stats = 15; |
| 260 | repeated AlertStats alert_stats = 16; |
Yangster-mac | 306ccc2 | 2018-03-24 15:03:40 -0700 | [diff] [blame] | 261 | repeated MetricStats metric_dimension_in_condition_stats = 17; |
David Chen | faa1af5 | 2018-03-30 15:14:04 -0700 | [diff] [blame] | 262 | message Annotation { |
| 263 | optional int64 field_int64 = 1; |
| 264 | optional int32 field_int32 = 2; |
| 265 | } |
| 266 | repeated Annotation annotation = 18; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | repeated ConfigStats config_stats = 3; |
| 270 | |
| 271 | message AtomStats { |
| 272 | optional int32 tag = 1; |
| 273 | optional int32 count = 2; |
| 274 | } |
| 275 | |
| 276 | repeated AtomStats atom_stats = 7; |
| 277 | |
| 278 | message UidMapStats { |
David Chen | bd12527 | 2018-04-04 19:02:50 -0700 | [diff] [blame] | 279 | optional int32 changes = 1; |
| 280 | optional int32 bytes_used = 2; |
| 281 | optional int32 dropped_changes = 3; |
| 282 | optional int32 deleted_apps = 4; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 283 | } |
| 284 | optional UidMapStats uidmap_stats = 8; |
| 285 | |
| 286 | message AnomalyAlarmStats { |
| 287 | optional int32 alarms_registered = 1; |
| 288 | } |
| 289 | optional AnomalyAlarmStats anomaly_alarm_stats = 9; |
| 290 | |
| 291 | message PulledAtomStats { |
| 292 | optional int32 atom_id = 1; |
| 293 | optional int64 total_pull = 2; |
| 294 | optional int64 total_pull_from_cache = 3; |
| 295 | optional int64 min_pull_interval_sec = 4; |
| 296 | } |
| 297 | repeated PulledAtomStats pulled_atom_stats = 10; |
| 298 | |
| 299 | message LoggerErrorStats { |
| 300 | optional int32 logger_disconnection_sec = 1; |
| 301 | optional int32 error_code = 2; |
| 302 | } |
| 303 | repeated LoggerErrorStats logger_error_stats = 11; |
Yangster-mac | b8382a1 | 2018-04-04 10:39:12 -0700 | [diff] [blame] | 304 | |
| 305 | message PeriodicAlarmStats { |
| 306 | optional int32 alarms_registered = 1; |
| 307 | } |
| 308 | optional PeriodicAlarmStats periodic_alarm_stats = 12; |
| 309 | |
| 310 | message SkippedLogEventStats { |
| 311 | optional int32 tag = 1; |
| 312 | optional int64 elapsed_timestamp_nanos = 2; |
| 313 | } |
| 314 | repeated SkippedLogEventStats skipped_log_event_stats = 13; |
Yao Chen | 163d260 | 2018-04-10 10:39:53 -0700 | [diff] [blame] | 315 | |
| 316 | repeated int64 log_loss_stats = 14; |
Yao Chen | 20e9e62 | 2018-02-28 11:18:51 -0800 | [diff] [blame] | 317 | } |