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