blob: b56cffb40806068a59bd66424286b2d3653d3cd3 [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
David Chen16049572018-02-01 18:27:51 -0800146 // Fields 2 and 3 are reserved.
yro00698da2017-09-15 10:06:40 -0700147
148 message EventMetricDataWrapper {
149 repeated EventMetricData data = 1;
150 }
151 message CountMetricDataWrapper {
152 repeated CountMetricData data = 1;
153 }
Yao Chencaf339d2017-10-06 16:01:10 -0700154 message DurationMetricDataWrapper {
Yao Chen729093d2017-10-16 10:33:26 -0700155 repeated DurationMetricData data = 1;
Yao Chencaf339d2017-10-06 16:01:10 -0700156 }
Yangsterfa28aec2017-10-30 10:29:52 -0700157 message ValueMetricDataWrapper {
158 repeated ValueMetricData data = 1;
159 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700160
Yangsterfa28aec2017-10-30 10:29:52 -0700161 message GaugeMetricDataWrapper {
162 repeated GaugeMetricData data = 1;
163 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700164
yro00698da2017-09-15 10:06:40 -0700165 oneof data {
166 EventMetricDataWrapper event_metrics = 4;
167 CountMetricDataWrapper count_metrics = 5;
Yao Chencaf339d2017-10-06 16:01:10 -0700168 DurationMetricDataWrapper duration_metrics = 6;
Yangsterfa28aec2017-10-30 10:29:52 -0700169 ValueMetricDataWrapper value_metrics = 7;
170 GaugeMetricDataWrapper gauge_metrics = 8;
yro00698da2017-09-15 10:06:40 -0700171 }
Yao Chenab273e22017-09-06 12:53:50 -0700172}
Yangsterfa28aec2017-10-30 10:29:52 -0700173
174message ConfigMetricsReport {
yro947fbce2017-11-15 22:50:23 -0800175 repeated StatsLogReport metrics = 1;
176
177 optional UidMapping uid_map = 2;
David Chen16049572018-02-01 18:27:51 -0800178
179 optional int64 last_report_nanos = 3;
180
181 optional int64 current_report_nanos = 4;
yro947fbce2017-11-15 22:50:23 -0800182}
183
184message ConfigMetricsReportList {
Yangsterfa28aec2017-10-30 10:29:52 -0700185 message ConfigKey {
186 optional int32 uid = 1;
Yangster-mac94e197c2018-01-02 16:03:03 -0800187 optional int64 id = 2;
Yangsterfa28aec2017-10-30 10:29:52 -0700188 }
189 optional ConfigKey config_key = 1;
190
yro947fbce2017-11-15 22:50:23 -0800191 repeated ConfigMetricsReport reports = 2;
Yangsterfa28aec2017-10-30 10:29:52 -0700192}
Yao Chenb3561512017-11-21 18:07:17 -0800193
194message StatsdStatsReport {
Yangsterb84e8b12018-01-22 16:18:34 -0800195 optional int32 stats_begin_time_sec = 1;
Yao Chenb3561512017-11-21 18:07:17 -0800196
Yangsterb84e8b12018-01-22 16:18:34 -0800197 optional int32 stats_end_time_sec = 2;
Yao Chenb3561512017-11-21 18:07:17 -0800198
Yangsterb84e8b12018-01-22 16:18:34 -0800199 message MatcherStats {
200 optional int64 id = 1;
201 optional int32 matched_times = 2;
202 }
Yao Chenb3561512017-11-21 18:07:17 -0800203
Yangsterb84e8b12018-01-22 16:18:34 -0800204 message ConditionStats {
205 optional int64 id = 1;
206 optional int32 max_tuple_counts = 2;
207 }
Yao Chenb3561512017-11-21 18:07:17 -0800208
Yangsterb84e8b12018-01-22 16:18:34 -0800209 message MetricStats {
210 optional int64 id = 1;
211 optional int32 max_tuple_counts = 2;
212 }
Yao Chenb3561512017-11-21 18:07:17 -0800213
Yangsterb84e8b12018-01-22 16:18:34 -0800214 message AlertStats {
215 optional int64 id = 1;
216 optional int32 alerted_times = 2;
217 }
Bookatz8f2f3d82017-12-07 13:53:21 -0800218
Yangsterb84e8b12018-01-22 16:18:34 -0800219 message ConfigStats {
220 optional int32 uid = 1;
221 optional int64 id = 2;
222 optional int32 creation_time_sec = 3;
223 optional int32 deletion_time_sec = 4;
224 optional int32 metric_count = 5;
225 optional int32 condition_count = 6;
226 optional int32 matcher_count = 7;
227 optional int32 alert_count = 8;
228 optional bool is_valid = 9;
Yao Chenb3561512017-11-21 18:07:17 -0800229
Yangsterb84e8b12018-01-22 16:18:34 -0800230 repeated int32 broadcast_sent_time_sec = 10;
231 repeated int32 data_drop_time_sec = 11;
232 repeated int32 dump_report_time_sec = 12;
233 repeated MatcherStats matcher_stats = 13;
234 repeated ConditionStats condition_stats = 14;
235 repeated MetricStats metric_stats = 15;
236 repeated AlertStats alert_stats = 16;
237 }
Yao Chenb3561512017-11-21 18:07:17 -0800238
Yangsterb84e8b12018-01-22 16:18:34 -0800239 repeated ConfigStats config_stats = 3;
Yao Chenb3561512017-11-21 18:07:17 -0800240
Yangsterb84e8b12018-01-22 16:18:34 -0800241 message AtomStats {
242 optional int32 tag = 1;
243 optional int32 count = 2;
244 }
Yao Chenb3561512017-11-21 18:07:17 -0800245
Yangsterb84e8b12018-01-22 16:18:34 -0800246 repeated AtomStats atom_stats = 7;
David Chenc136f452017-11-27 11:52:26 -0800247
Yangsterb84e8b12018-01-22 16:18:34 -0800248 message UidMapStats {
249 optional int32 snapshots = 1;
250 optional int32 changes = 2;
251 optional int32 bytes_used = 3;
252 optional int32 dropped_snapshots = 4;
253 optional int32 dropped_changes = 5;
254 }
255 optional UidMapStats uidmap_stats = 8;
Bookatz1d0136d2017-12-01 11:13:32 -0800256
Yangsterb84e8b12018-01-22 16:18:34 -0800257 message AnomalyAlarmStats {
258 optional int32 alarms_registered = 1;
259 }
260 optional AnomalyAlarmStats anomaly_alarm_stats = 9;
Chenjie Yub038b702017-12-18 15:15:34 -0800261
Yangsterb84e8b12018-01-22 16:18:34 -0800262 message PulledAtomStats {
263 optional int32 atom_id = 1;
264 optional int64 total_pull = 2;
265 optional int64 total_pull_from_cache = 3;
266 optional int64 min_pull_interval_sec = 4;
267 }
268 repeated PulledAtomStats pulled_atom_stats = 10;
Yao Chen884c8c12018-01-26 10:36:25 -0800269
270 message LoggerErrorStats {
271 optional int32 logger_disconnection_sec = 1;
272 optional int32 error_code = 2;
273 }
274 repeated LoggerErrorStats logger_error_stats = 11;
Yao Chenb3561512017-11-21 18:07:17 -0800275}