blob: af21ca4d82e87683352b742504ef02f9c3950ed0 [file] [log] [blame]
Yao Chenab273e22017-09-06 12:53:50 -07001/*
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 Lafoncdb1a0e2017-09-27 20:24:15 -070016
Yao Chenab273e22017-09-06 12:53:50 -070017syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018option optimize_for = LITE_RUNTIME;
Yao Chenab273e22017-09-06 12:53:50 -070019
20package android.os.statsd;
21
Yao Chenab273e22017-09-06 12:53:50 -070022option java_package = "com.android.os";
23option java_outer_classname = "StatsLog";
24
Joe Onorato62c220b2017-11-18 20:32:56 -080025import "frameworks/base/cmds/statsd/src/atoms.proto";
Yao Chenab273e22017-09-06 12:53:50 -070026
Yangster-mac20877162017-12-22 17:19:39 -080027message DimensionsValue {
28 optional int32 field = 1;
Yao Chenab273e22017-09-06 12:53:50 -070029
yro00698da2017-09-15 10:06:40 -070030 oneof value {
31 string value_str = 2;
Chenjie Yud9dfda72017-12-11 17:41:20 -080032 int32 value_int = 3;
33 int64 value_long = 4;
34 bool value_bool = 5;
35 float value_float = 6;
Yangster-mac20877162017-12-22 17:19:39 -080036 DimensionsValueTuple value_tuple = 7;
Yao Chenab273e22017-09-06 12:53:50 -070037 }
Yao Chenab273e22017-09-06 12:53:50 -070038}
39
Yangster-mac20877162017-12-22 17:19:39 -080040message DimensionsValueTuple {
41 repeated DimensionsValue dimensions_value = 1;
42}
43
yro00698da2017-09-15 10:06:40 -070044message EventMetricData {
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070045 optional int64 timestamp_nanos = 1;
yro00698da2017-09-15 10:06:40 -070046
Stefan Lafonae2df012017-11-14 09:17:21 -080047 optional Atom atom = 2;
yro00698da2017-09-15 10:06:40 -070048}
49
50message CountBucketInfo {
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070051 optional int64 start_bucket_nanos = 1;
yro00698da2017-09-15 10:06:40 -070052
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070053 optional int64 end_bucket_nanos = 2;
yro00698da2017-09-15 10:06:40 -070054
55 optional int64 count = 3;
56}
57
58message CountMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -080059 optional DimensionsValue dimensions_in_what = 1;
60
Yangster-mac16fc72f2018-01-18 13:18:01 -080061 optional DimensionsValue dimensions_in_condition = 2;
yro00698da2017-09-15 10:06:40 -070062
Yangster-mac16fc72f2018-01-18 13:18:01 -080063 repeated CountBucketInfo bucket_info = 3;
yro00698da2017-09-15 10:06:40 -070064}
65
Yao Chencaf339d2017-10-06 16:01:10 -070066message 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
74message DurationMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -080075 optional DimensionsValue dimensions_in_what = 1;
76
Yangster-mac16fc72f2018-01-18 13:18:01 -080077 optional DimensionsValue dimensions_in_condition = 2;
Yao Chencaf339d2017-10-06 16:01:10 -070078
Yangster-mac16fc72f2018-01-18 13:18:01 -080079 repeated DurationBucketInfo bucket_info = 3;
Yao Chencaf339d2017-10-06 16:01:10 -070080}
81
Yangsterfa28aec2017-10-30 10:29:52 -070082message ValueBucketInfo {
83 optional int64 start_bucket_nanos = 1;
84
85 optional int64 end_bucket_nanos = 2;
86
87 optional int64 value = 3;
88}
89
90message ValueMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -080091 optional DimensionsValue dimensions_in_what = 1;
92
Yangster-mac16fc72f2018-01-18 13:18:01 -080093 optional DimensionsValue dimensions_in_condition = 2;
Yangsterfa28aec2017-10-30 10:29:52 -070094
Yangster-mac16fc72f2018-01-18 13:18:01 -080095 repeated ValueBucketInfo bucket_info = 3;
Yangsterfa28aec2017-10-30 10:29:52 -070096}
97
98message GaugeBucketInfo {
99 optional int64 start_bucket_nanos = 1;
100
101 optional int64 end_bucket_nanos = 2;
102
Yangster-mac34ea1102018-01-29 12:40:55 -0800103 repeated Atom atom = 3;
104
105 repeated int64 timestamp_nanos = 4;
Yangsterfa28aec2017-10-30 10:29:52 -0700106}
107
108message GaugeMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -0800109 optional DimensionsValue dimensions_in_what = 1;
110
Yangster-mac16fc72f2018-01-18 13:18:01 -0800111 optional DimensionsValue dimensions_in_condition = 2;
Yangsterfa28aec2017-10-30 10:29:52 -0700112
Yangster-mac16fc72f2018-01-18 13:18:01 -0800113 repeated GaugeBucketInfo bucket_info = 3;
Yangsterfa28aec2017-10-30 10:29:52 -0700114}
115
Yao Chencaf339d2017-10-06 16:01:10 -0700116message UidMapping {
David Chend6896892017-10-25 11:49:03 -0700117 message PackageInfoSnapshot {
118 message PackageInfo {
119 optional string name = 1;
Yao Chencaf339d2017-10-06 16:01:10 -0700120
Dianne Hackborn3accca02013-09-20 09:32:11 -0700121 optional int64 version = 2;
Yao Chencaf339d2017-10-06 16:01:10 -0700122
David Chend6896892017-10-25 11:49:03 -0700123 optional int32 uid = 3;
124 }
125 optional int64 timestamp_nanos = 1;
126
127 repeated PackageInfo package_info = 2;
Yao Chencaf339d2017-10-06 16:01:10 -0700128 }
David Chend6896892017-10-25 11:49:03 -0700129 repeated PackageInfoSnapshot snapshots = 1;
Yao Chencaf339d2017-10-06 16:01:10 -0700130
131 message Change {
132 optional bool deletion = 1;
133
Yangsterfa28aec2017-10-30 10:29:52 -0700134 optional int64 timestamp_nanos = 2;
Yao Chencaf339d2017-10-06 16:01:10 -0700135 optional string app = 3;
136 optional int32 uid = 4;
137
Dianne Hackborn3accca02013-09-20 09:32:11 -0700138 optional int64 version = 5;
Yao Chencaf339d2017-10-06 16:01:10 -0700139 }
140 repeated Change changes = 2;
141}
142
yro00698da2017-09-15 10:06:40 -0700143message StatsLogReport {
Yangster-mac94e197c2018-01-02 16:03:03 -0800144 optional int64 metric_id = 1;
Yao Chenab273e22017-09-06 12:53:50 -0700145
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700146 optional int64 start_report_nanos = 2;
yro00698da2017-09-15 10:06:40 -0700147
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700148 optional int64 end_report_nanos = 3;
yro00698da2017-09-15 10:06:40 -0700149
150 message EventMetricDataWrapper {
151 repeated EventMetricData data = 1;
152 }
153 message CountMetricDataWrapper {
154 repeated CountMetricData data = 1;
155 }
Yao Chencaf339d2017-10-06 16:01:10 -0700156 message DurationMetricDataWrapper {
Yao Chen729093d2017-10-16 10:33:26 -0700157 repeated DurationMetricData data = 1;
Yao Chencaf339d2017-10-06 16:01:10 -0700158 }
Yangsterfa28aec2017-10-30 10:29:52 -0700159 message ValueMetricDataWrapper {
160 repeated ValueMetricData data = 1;
161 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700162
Yangsterfa28aec2017-10-30 10:29:52 -0700163 message GaugeMetricDataWrapper {
164 repeated GaugeMetricData data = 1;
165 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700166
yro00698da2017-09-15 10:06:40 -0700167 oneof data {
168 EventMetricDataWrapper event_metrics = 4;
169 CountMetricDataWrapper count_metrics = 5;
Yao Chencaf339d2017-10-06 16:01:10 -0700170 DurationMetricDataWrapper duration_metrics = 6;
Yangsterfa28aec2017-10-30 10:29:52 -0700171 ValueMetricDataWrapper value_metrics = 7;
172 GaugeMetricDataWrapper gauge_metrics = 8;
yro00698da2017-09-15 10:06:40 -0700173 }
Yao Chenab273e22017-09-06 12:53:50 -0700174}
Yangsterfa28aec2017-10-30 10:29:52 -0700175
176message ConfigMetricsReport {
yro947fbce2017-11-15 22:50:23 -0800177 repeated StatsLogReport metrics = 1;
178
179 optional UidMapping uid_map = 2;
180}
181
182message ConfigMetricsReportList {
Yangsterfa28aec2017-10-30 10:29:52 -0700183 message ConfigKey {
184 optional int32 uid = 1;
Yangster-mac94e197c2018-01-02 16:03:03 -0800185 optional int64 id = 2;
Yangsterfa28aec2017-10-30 10:29:52 -0700186 }
187 optional ConfigKey config_key = 1;
188
yro947fbce2017-11-15 22:50:23 -0800189 repeated ConfigMetricsReport reports = 2;
Yangsterfa28aec2017-10-30 10:29:52 -0700190}
Yao Chenb3561512017-11-21 18:07:17 -0800191
192message StatsdStatsReport {
Yangsterb84e8b12018-01-22 16:18:34 -0800193 optional int32 stats_begin_time_sec = 1;
Yao Chenb3561512017-11-21 18:07:17 -0800194
Yangsterb84e8b12018-01-22 16:18:34 -0800195 optional int32 stats_end_time_sec = 2;
Yao Chenb3561512017-11-21 18:07:17 -0800196
Yangsterb84e8b12018-01-22 16:18:34 -0800197 message MatcherStats {
198 optional int64 id = 1;
199 optional int32 matched_times = 2;
200 }
Yao Chenb3561512017-11-21 18:07:17 -0800201
Yangsterb84e8b12018-01-22 16:18:34 -0800202 message ConditionStats {
203 optional int64 id = 1;
204 optional int32 max_tuple_counts = 2;
205 }
Yao Chenb3561512017-11-21 18:07:17 -0800206
Yangsterb84e8b12018-01-22 16:18:34 -0800207 message MetricStats {
208 optional int64 id = 1;
209 optional int32 max_tuple_counts = 2;
210 }
Yao Chenb3561512017-11-21 18:07:17 -0800211
Yangsterb84e8b12018-01-22 16:18:34 -0800212 message AlertStats {
213 optional int64 id = 1;
214 optional int32 alerted_times = 2;
215 }
Bookatz8f2f3d82017-12-07 13:53:21 -0800216
Yangsterb84e8b12018-01-22 16:18:34 -0800217 message ConfigStats {
218 optional int32 uid = 1;
219 optional int64 id = 2;
220 optional int32 creation_time_sec = 3;
221 optional int32 deletion_time_sec = 4;
222 optional int32 metric_count = 5;
223 optional int32 condition_count = 6;
224 optional int32 matcher_count = 7;
225 optional int32 alert_count = 8;
226 optional bool is_valid = 9;
Yao Chenb3561512017-11-21 18:07:17 -0800227
Yangsterb84e8b12018-01-22 16:18:34 -0800228 repeated int32 broadcast_sent_time_sec = 10;
229 repeated int32 data_drop_time_sec = 11;
230 repeated int32 dump_report_time_sec = 12;
231 repeated MatcherStats matcher_stats = 13;
232 repeated ConditionStats condition_stats = 14;
233 repeated MetricStats metric_stats = 15;
234 repeated AlertStats alert_stats = 16;
235 }
Yao Chenb3561512017-11-21 18:07:17 -0800236
Yangsterb84e8b12018-01-22 16:18:34 -0800237 repeated ConfigStats config_stats = 3;
Yao Chenb3561512017-11-21 18:07:17 -0800238
Yangsterb84e8b12018-01-22 16:18:34 -0800239 message AtomStats {
240 optional int32 tag = 1;
241 optional int32 count = 2;
242 }
Yao Chenb3561512017-11-21 18:07:17 -0800243
Yangsterb84e8b12018-01-22 16:18:34 -0800244 repeated AtomStats atom_stats = 7;
David Chenc136f45a2017-11-27 11:52:26 -0800245
Yangsterb84e8b12018-01-22 16:18:34 -0800246 message UidMapStats {
247 optional int32 snapshots = 1;
248 optional int32 changes = 2;
249 optional int32 bytes_used = 3;
250 optional int32 dropped_snapshots = 4;
251 optional int32 dropped_changes = 5;
252 }
253 optional UidMapStats uidmap_stats = 8;
Bookatz1d0136d2017-12-01 11:13:32 -0800254
Yangsterb84e8b12018-01-22 16:18:34 -0800255 message AnomalyAlarmStats {
256 optional int32 alarms_registered = 1;
257 }
258 optional AnomalyAlarmStats anomaly_alarm_stats = 9;
Chenjie Yub038b702017-12-18 15:15:34 -0800259
Yangsterb84e8b12018-01-22 16:18:34 -0800260 message PulledAtomStats {
261 optional int32 atom_id = 1;
262 optional int64 total_pull = 2;
263 optional int64 total_pull_from_cache = 3;
264 optional int64 min_pull_interval_sec = 4;
265 }
266 repeated PulledAtomStats pulled_atom_stats = 10;
Yao Chen884c8c12018-01-26 10:36:25 -0800267
268 message LoggerErrorStats {
269 optional int32 logger_disconnection_sec = 1;
270 optional int32 error_code = 2;
271 }
272 repeated LoggerErrorStats logger_error_stats = 11;
Yao Chenb3561512017-11-21 18:07:17 -0800273}