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 Field { |
| 28 | optional int32 field = 1; |
| 29 | optional int32 position_index = 2 [default = -1]; |
| 30 | repeated Field child = 3; |
| 31 | } |
| 32 | |
| 33 | message DimensionsValue { |
| 34 | optional int32 field = 1; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 35 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 36 | oneof value { |
| 37 | string value_str = 2; |
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 38 | int32 value_int = 3; |
| 39 | int64 value_long = 4; |
| 40 | bool value_bool = 5; |
| 41 | float value_float = 6; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 42 | DimensionsValueTuple value_tuple = 7; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 43 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 44 | } |
| 45 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 46 | message DimensionsValueTuple { |
| 47 | repeated DimensionsValue dimensions_value = 1; |
| 48 | } |
| 49 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 50 | message EventMetricData { |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 51 | optional int64 timestamp_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 52 | |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 53 | optional Atom atom = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | message CountBucketInfo { |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 57 | optional int64 start_bucket_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 58 | |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 59 | optional int64 end_bucket_nanos = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 60 | |
| 61 | optional int64 count = 3; |
| 62 | } |
| 63 | |
| 64 | message CountMetricData { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 65 | optional DimensionsValue dimension = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 66 | |
| 67 | repeated CountBucketInfo bucket_info = 2; |
| 68 | } |
| 69 | |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 70 | message DurationBucketInfo { |
| 71 | optional int64 start_bucket_nanos = 1; |
| 72 | |
| 73 | optional int64 end_bucket_nanos = 2; |
| 74 | |
| 75 | optional int64 duration_nanos = 3; |
| 76 | } |
| 77 | |
| 78 | message DurationMetricData { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 79 | optional DimensionsValue dimension = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 80 | |
| 81 | repeated DurationBucketInfo bucket_info = 2; |
| 82 | } |
| 83 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 84 | message ValueBucketInfo { |
| 85 | optional int64 start_bucket_nanos = 1; |
| 86 | |
| 87 | optional int64 end_bucket_nanos = 2; |
| 88 | |
| 89 | optional int64 value = 3; |
| 90 | } |
| 91 | |
| 92 | message ValueMetricData { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 93 | optional DimensionsValue dimension = 1; |
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 | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 107 | optional DimensionsValue dimension = 1; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 108 | |
| 109 | repeated GaugeBucketInfo bucket_info = 2; |
| 110 | } |
| 111 | |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 112 | message UidMapping { |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 113 | message PackageInfoSnapshot { |
| 114 | message PackageInfo { |
| 115 | optional string name = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 116 | |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 117 | optional int64 version = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 118 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 119 | optional int32 uid = 3; |
| 120 | } |
| 121 | optional int64 timestamp_nanos = 1; |
| 122 | |
| 123 | repeated PackageInfo package_info = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 124 | } |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 125 | repeated PackageInfoSnapshot snapshots = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 126 | |
| 127 | message Change { |
| 128 | optional bool deletion = 1; |
| 129 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 130 | optional int64 timestamp_nanos = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 131 | optional string app = 3; |
| 132 | optional int32 uid = 4; |
| 133 | |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 134 | optional int64 version = 5; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 135 | } |
| 136 | repeated Change changes = 2; |
| 137 | } |
| 138 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 139 | message StatsLogReport { |
Yao Chen | 1ff4f43 | 2017-11-16 17:01:40 -0800 | [diff] [blame] | 140 | optional string metric_name = 1; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 141 | |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 142 | optional int64 start_report_nanos = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 143 | |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 144 | optional int64 end_report_nanos = 3; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 145 | |
| 146 | message EventMetricDataWrapper { |
| 147 | repeated EventMetricData data = 1; |
| 148 | } |
| 149 | message CountMetricDataWrapper { |
| 150 | repeated CountMetricData data = 1; |
| 151 | } |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 152 | message DurationMetricDataWrapper { |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 153 | repeated DurationMetricData data = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 154 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 155 | message ValueMetricDataWrapper { |
| 156 | repeated ValueMetricData data = 1; |
| 157 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 158 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 159 | message GaugeMetricDataWrapper { |
| 160 | repeated GaugeMetricData data = 1; |
| 161 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 162 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 163 | oneof data { |
| 164 | EventMetricDataWrapper event_metrics = 4; |
| 165 | CountMetricDataWrapper count_metrics = 5; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 166 | DurationMetricDataWrapper duration_metrics = 6; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 167 | ValueMetricDataWrapper value_metrics = 7; |
| 168 | GaugeMetricDataWrapper gauge_metrics = 8; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 169 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 170 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 171 | |
| 172 | message ConfigMetricsReport { |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 173 | repeated StatsLogReport metrics = 1; |
| 174 | |
| 175 | optional UidMapping uid_map = 2; |
| 176 | } |
| 177 | |
| 178 | message ConfigMetricsReportList { |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 179 | message ConfigKey { |
| 180 | optional int32 uid = 1; |
| 181 | optional string name = 2; |
| 182 | } |
| 183 | optional ConfigKey config_key = 1; |
| 184 | |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 185 | repeated ConfigMetricsReport reports = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 186 | } |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 187 | |
| 188 | message StatsdStatsReport { |
| 189 | optional int32 stats_begin_time_sec = 1; |
| 190 | |
| 191 | optional int32 stats_end_time_sec = 2; |
| 192 | |
| 193 | message MatcherStats { |
| 194 | optional string name = 1; |
| 195 | optional int32 matched_times = 2; |
| 196 | } |
| 197 | |
| 198 | message ConditionStats { |
| 199 | optional string name = 1; |
| 200 | optional int32 max_tuple_counts = 2; |
| 201 | } |
| 202 | |
| 203 | message MetricStats { |
| 204 | optional string name = 1; |
| 205 | optional int32 max_tuple_counts = 2; |
| 206 | } |
| 207 | |
Bookatz | 8f2f3d8 | 2017-12-07 13:53:21 -0800 | [diff] [blame] | 208 | message AlertStats { |
| 209 | optional string name = 1; |
Bookatz | e1d143a | 2017-12-13 15:21:57 -0800 | [diff] [blame] | 210 | optional int32 alerted_times = 2; |
Bookatz | 8f2f3d8 | 2017-12-07 13:53:21 -0800 | [diff] [blame] | 211 | } |
| 212 | |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 213 | message ConfigStats { |
| 214 | optional int32 uid = 1; |
| 215 | optional string name = 2; |
| 216 | optional int32 creation_time_sec = 3; |
| 217 | optional int32 deletion_time_sec = 4; |
| 218 | optional int32 metric_count = 5; |
| 219 | optional int32 condition_count = 6; |
| 220 | optional int32 matcher_count = 7; |
| 221 | optional int32 alert_count = 8; |
| 222 | optional bool is_valid = 9; |
| 223 | |
| 224 | repeated int32 broadcast_sent_time_sec = 10; |
| 225 | repeated int32 data_drop_time_sec = 11; |
Yao Chen | 69f1baf | 2017-11-27 17:25:36 -0800 | [diff] [blame] | 226 | repeated int32 dump_report_time_sec = 12; |
| 227 | repeated MatcherStats matcher_stats = 13; |
| 228 | repeated ConditionStats condition_stats = 14; |
| 229 | repeated MetricStats metric_stats = 15; |
Bookatz | 8f2f3d8 | 2017-12-07 13:53:21 -0800 | [diff] [blame] | 230 | repeated AlertStats alert_stats = 16; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | repeated ConfigStats config_stats = 3; |
| 234 | |
| 235 | message AtomStats { |
| 236 | optional int32 tag = 1; |
| 237 | optional int32 count = 2; |
| 238 | } |
| 239 | |
| 240 | repeated AtomStats atom_stats = 7; |
David Chen | c136f45 | 2017-11-27 11:52:26 -0800 | [diff] [blame] | 241 | |
| 242 | message UidMapStats { |
| 243 | optional int32 snapshots = 1; |
| 244 | optional int32 changes = 2; |
| 245 | optional int32 bytes_used = 3; |
| 246 | optional int32 dropped_snapshots = 4; |
| 247 | optional int32 dropped_changes = 5; |
| 248 | } |
| 249 | optional UidMapStats uidmap_stats = 8; |
Bookatz | 1d0136d | 2017-12-01 11:13:32 -0800 | [diff] [blame] | 250 | |
| 251 | message AnomalyAlarmStats { |
| 252 | optional int32 alarms_registered = 1; |
| 253 | } |
| 254 | optional AnomalyAlarmStats anomaly_alarm_stats = 9; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 255 | } |