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 | |
| 61 | optional DimensionsValue dimensions_in_condition = 3; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 62 | |
| 63 | repeated CountBucketInfo bucket_info = 2; |
| 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 | |
| 77 | optional DimensionsValue dimensions_in_condition = 3; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 78 | |
| 79 | repeated DurationBucketInfo bucket_info = 2; |
| 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 | |
| 93 | optional DimensionsValue dimensions_in_condition = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 94 | |
| 95 | repeated ValueBucketInfo bucket_info = 2; |
| 96 | } |
| 97 | |
| 98 | message GaugeBucketInfo { |
| 99 | optional int64 start_bucket_nanos = 1; |
| 100 | |
| 101 | optional int64 end_bucket_nanos = 2; |
| 102 | |
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 103 | optional Atom atom = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | message GaugeMetricData { |
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame^] | 107 | optional DimensionsValue dimensions_in_what = 1; |
| 108 | |
| 109 | optional DimensionsValue dimensions_in_condition = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 110 | |
| 111 | repeated GaugeBucketInfo bucket_info = 2; |
| 112 | } |
| 113 | |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 114 | message UidMapping { |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 115 | message PackageInfoSnapshot { |
| 116 | message PackageInfo { |
| 117 | optional string name = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 118 | |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 119 | optional int64 version = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 120 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 121 | optional int32 uid = 3; |
| 122 | } |
| 123 | optional int64 timestamp_nanos = 1; |
| 124 | |
| 125 | repeated PackageInfo package_info = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 126 | } |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 127 | repeated PackageInfoSnapshot snapshots = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 128 | |
| 129 | message Change { |
| 130 | optional bool deletion = 1; |
| 131 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 132 | optional int64 timestamp_nanos = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 133 | optional string app = 3; |
| 134 | optional int32 uid = 4; |
| 135 | |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 136 | optional int64 version = 5; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 137 | } |
| 138 | repeated Change changes = 2; |
| 139 | } |
| 140 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 141 | message StatsLogReport { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 142 | optional int64 metric_id = 1; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 143 | |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 144 | optional int64 start_report_nanos = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 145 | |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 146 | optional int64 end_report_nanos = 3; |
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; |
| 178 | } |
| 179 | |
| 180 | message ConfigMetricsReportList { |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 181 | message ConfigKey { |
| 182 | optional int32 uid = 1; |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 183 | optional int64 id = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 184 | } |
| 185 | optional ConfigKey config_key = 1; |
| 186 | |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 187 | repeated ConfigMetricsReport reports = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 188 | } |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 189 | |
| 190 | message StatsdStatsReport { |
| 191 | optional int32 stats_begin_time_sec = 1; |
| 192 | |
| 193 | optional int32 stats_end_time_sec = 2; |
| 194 | |
| 195 | message MatcherStats { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 196 | optional int64 id = 1; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 197 | optional int32 matched_times = 2; |
| 198 | } |
| 199 | |
| 200 | message ConditionStats { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 201 | optional int64 id = 1; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 202 | optional int32 max_tuple_counts = 2; |
| 203 | } |
| 204 | |
| 205 | message MetricStats { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 206 | optional int64 id = 1; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 207 | optional int32 max_tuple_counts = 2; |
| 208 | } |
| 209 | |
Bookatz | 8f2f3d8 | 2017-12-07 13:53:21 -0800 | [diff] [blame] | 210 | message AlertStats { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 211 | optional int64 id = 1; |
Bookatz | e1d143a | 2017-12-13 15:21:57 -0800 | [diff] [blame] | 212 | optional int32 alerted_times = 2; |
Bookatz | 8f2f3d8 | 2017-12-07 13:53:21 -0800 | [diff] [blame] | 213 | } |
| 214 | |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 215 | message ConfigStats { |
| 216 | optional int32 uid = 1; |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 217 | optional int64 id = 2; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 218 | optional int32 creation_time_sec = 3; |
| 219 | optional int32 deletion_time_sec = 4; |
| 220 | optional int32 metric_count = 5; |
| 221 | optional int32 condition_count = 6; |
| 222 | optional int32 matcher_count = 7; |
| 223 | optional int32 alert_count = 8; |
| 224 | optional bool is_valid = 9; |
| 225 | |
| 226 | repeated int32 broadcast_sent_time_sec = 10; |
| 227 | repeated int32 data_drop_time_sec = 11; |
Yao Chen | 69f1baf | 2017-11-27 17:25:36 -0800 | [diff] [blame] | 228 | repeated int32 dump_report_time_sec = 12; |
| 229 | repeated MatcherStats matcher_stats = 13; |
| 230 | repeated ConditionStats condition_stats = 14; |
| 231 | repeated MetricStats metric_stats = 15; |
Bookatz | 8f2f3d8 | 2017-12-07 13:53:21 -0800 | [diff] [blame] | 232 | repeated AlertStats alert_stats = 16; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | repeated ConfigStats config_stats = 3; |
| 236 | |
| 237 | message AtomStats { |
| 238 | optional int32 tag = 1; |
| 239 | optional int32 count = 2; |
| 240 | } |
| 241 | |
| 242 | repeated AtomStats atom_stats = 7; |
David Chen | c136f45a | 2017-11-27 11:52:26 -0800 | [diff] [blame] | 243 | |
| 244 | message UidMapStats { |
| 245 | optional int32 snapshots = 1; |
| 246 | optional int32 changes = 2; |
| 247 | optional int32 bytes_used = 3; |
| 248 | optional int32 dropped_snapshots = 4; |
| 249 | optional int32 dropped_changes = 5; |
| 250 | } |
| 251 | optional UidMapStats uidmap_stats = 8; |
Bookatz | 1d0136d | 2017-12-01 11:13:32 -0800 | [diff] [blame] | 252 | |
| 253 | message AnomalyAlarmStats { |
| 254 | optional int32 alarms_registered = 1; |
| 255 | } |
| 256 | optional AnomalyAlarmStats anomaly_alarm_stats = 9; |
Chenjie Yu | b038b70 | 2017-12-18 15:15:34 -0800 | [diff] [blame] | 257 | |
| 258 | message PulledAtomStats { |
| 259 | optional int32 atom_id = 1; |
| 260 | optional int64 total_pull = 2; |
| 261 | optional int64 total_pull_from_cache = 3; |
| 262 | optional int64 min_pull_interval_sec = 4; |
| 263 | } |
| 264 | repeated PulledAtomStats pulled_atom_stats = 10; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 265 | } |