blob: 272e90be662da6eb9395f7e34e546f16d5ce593c [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";
18
19package android.os.statsd;
20
Yao Chenab273e22017-09-06 12:53:50 -070021option java_package = "com.android.os";
22option java_outer_classname = "StatsLog";
23
Joe Onorato62c220b2017-11-18 20:32:56 -080024import "frameworks/base/cmds/statsd/src/atoms.proto";
Yao Chen9c1debe2018-02-19 14:39:19 -080025import "frameworks/base/cmds/statsd/src/stats_log_common.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 {
Yangster-mac330af582018-02-08 15:24:38 -080045 optional int64 elapsed_timestamp_nanos = 1;
yro00698da2017-09-15 10:06:40 -070046
Stefan Lafonae2df012017-11-14 09:17:21 -080047 optional Atom atom = 2;
Yangster-mac330af582018-02-08 15:24:38 -080048
49 optional int64 wall_clock_timestamp_sec = 3;
yro00698da2017-09-15 10:06:40 -070050}
51
52message CountBucketInfo {
Yangster-mac330af582018-02-08 15:24:38 -080053 optional int64 start_bucket_elapsed_nanos = 1;
yro00698da2017-09-15 10:06:40 -070054
Yangster-mac330af582018-02-08 15:24:38 -080055 optional int64 end_bucket_elapsed_nanos = 2;
yro00698da2017-09-15 10:06:40 -070056
57 optional int64 count = 3;
58}
59
60message CountMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -080061 optional DimensionsValue dimensions_in_what = 1;
62
Yangster-mac16fc72f2018-01-18 13:18:01 -080063 optional DimensionsValue dimensions_in_condition = 2;
yro00698da2017-09-15 10:06:40 -070064
Yangster-mac16fc72f2018-01-18 13:18:01 -080065 repeated CountBucketInfo bucket_info = 3;
yro00698da2017-09-15 10:06:40 -070066}
67
Yao Chencaf339d2017-10-06 16:01:10 -070068message DurationBucketInfo {
Yangster-mac330af582018-02-08 15:24:38 -080069 optional int64 start_bucket_elapsed_nanos = 1;
Yao Chencaf339d2017-10-06 16:01:10 -070070
Yangster-mac330af582018-02-08 15:24:38 -080071 optional int64 end_bucket_elapsed_nanos = 2;
Yao Chencaf339d2017-10-06 16:01:10 -070072
73 optional int64 duration_nanos = 3;
74}
75
76message DurationMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -080077 optional DimensionsValue dimensions_in_what = 1;
78
Yangster-mac16fc72f2018-01-18 13:18:01 -080079 optional DimensionsValue dimensions_in_condition = 2;
Yao Chencaf339d2017-10-06 16:01:10 -070080
Yangster-mac16fc72f2018-01-18 13:18:01 -080081 repeated DurationBucketInfo bucket_info = 3;
Yao Chencaf339d2017-10-06 16:01:10 -070082}
83
Yangsterfa28aec2017-10-30 10:29:52 -070084message ValueBucketInfo {
Yangster-mac330af582018-02-08 15:24:38 -080085 optional int64 start_bucket_elapsed_nanos = 1;
Yangsterfa28aec2017-10-30 10:29:52 -070086
Yangster-mac330af582018-02-08 15:24:38 -080087 optional int64 end_bucket_elapsed_nanos = 2;
Yangsterfa28aec2017-10-30 10:29:52 -070088
89 optional int64 value = 3;
90}
91
92message ValueMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -080093 optional DimensionsValue dimensions_in_what = 1;
94
Yangster-mac16fc72f2018-01-18 13:18:01 -080095 optional DimensionsValue dimensions_in_condition = 2;
Yangsterfa28aec2017-10-30 10:29:52 -070096
Yangster-mac16fc72f2018-01-18 13:18:01 -080097 repeated ValueBucketInfo bucket_info = 3;
Yangsterfa28aec2017-10-30 10:29:52 -070098}
99
100message GaugeBucketInfo {
101 optional int64 start_bucket_nanos = 1;
102
103 optional int64 end_bucket_nanos = 2;
104
Yangster-mac34ea1102018-01-29 12:40:55 -0800105 repeated Atom atom = 3;
106
Yangster-mac330af582018-02-08 15:24:38 -0800107 repeated int64 elapsed_timestamp_nanos = 4;
Yangsterfa28aec2017-10-30 10:29:52 -0700108}
109
110message GaugeMetricData {
Yangster-mac468ff042018-01-17 12:26:34 -0800111 optional DimensionsValue dimensions_in_what = 1;
112
Yangster-mac16fc72f2018-01-18 13:18:01 -0800113 optional DimensionsValue dimensions_in_condition = 2;
Yangsterfa28aec2017-10-30 10:29:52 -0700114
Yangster-mac16fc72f2018-01-18 13:18:01 -0800115 repeated GaugeBucketInfo bucket_info = 3;
Yangsterfa28aec2017-10-30 10:29:52 -0700116}
117
yro00698da2017-09-15 10:06:40 -0700118message StatsLogReport {
Yangster-mac94e197c2018-01-02 16:03:03 -0800119 optional int64 metric_id = 1;
Yao Chenab273e22017-09-06 12:53:50 -0700120
David Chen16049572018-02-01 18:27:51 -0800121 // Fields 2 and 3 are reserved.
yro00698da2017-09-15 10:06:40 -0700122
123 message EventMetricDataWrapper {
124 repeated EventMetricData data = 1;
125 }
126 message CountMetricDataWrapper {
127 repeated CountMetricData data = 1;
128 }
Yao Chencaf339d2017-10-06 16:01:10 -0700129 message DurationMetricDataWrapper {
Yao Chen729093d2017-10-16 10:33:26 -0700130 repeated DurationMetricData data = 1;
Yao Chencaf339d2017-10-06 16:01:10 -0700131 }
Yangsterfa28aec2017-10-30 10:29:52 -0700132 message ValueMetricDataWrapper {
133 repeated ValueMetricData data = 1;
134 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700135
Yangsterfa28aec2017-10-30 10:29:52 -0700136 message GaugeMetricDataWrapper {
137 repeated GaugeMetricData data = 1;
138 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700139
yro00698da2017-09-15 10:06:40 -0700140 oneof data {
141 EventMetricDataWrapper event_metrics = 4;
142 CountMetricDataWrapper count_metrics = 5;
Yao Chencaf339d2017-10-06 16:01:10 -0700143 DurationMetricDataWrapper duration_metrics = 6;
Yangsterfa28aec2017-10-30 10:29:52 -0700144 ValueMetricDataWrapper value_metrics = 7;
145 GaugeMetricDataWrapper gauge_metrics = 8;
yro00698da2017-09-15 10:06:40 -0700146 }
Yao Chenab273e22017-09-06 12:53:50 -0700147}
Yangsterfa28aec2017-10-30 10:29:52 -0700148
149message ConfigMetricsReport {
yro947fbce2017-11-15 22:50:23 -0800150 repeated StatsLogReport metrics = 1;
151
152 optional UidMapping uid_map = 2;
David Chen16049572018-02-01 18:27:51 -0800153
Yangster-mac330af582018-02-08 15:24:38 -0800154 optional int64 last_report_elapsed_nanos = 3;
David Chen16049572018-02-01 18:27:51 -0800155
Yangster-mac330af582018-02-08 15:24:38 -0800156 optional int64 current_report_elapsed_nanos = 4;
yro947fbce2017-11-15 22:50:23 -0800157}
158
159message ConfigMetricsReportList {
Yangsterfa28aec2017-10-30 10:29:52 -0700160 message ConfigKey {
161 optional int32 uid = 1;
Yangster-mac94e197c2018-01-02 16:03:03 -0800162 optional int64 id = 2;
Yangsterfa28aec2017-10-30 10:29:52 -0700163 }
164 optional ConfigKey config_key = 1;
165
yro947fbce2017-11-15 22:50:23 -0800166 repeated ConfigMetricsReport reports = 2;
Yao Chenb3561512017-11-21 18:07:17 -0800167}