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"; |
18 | |||||
19 | package android.os.statsd; | ||||
20 | |||||
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 21 | option java_package = "com.android.os"; |
22 | option java_outer_classname = "StatsLog"; | ||||
23 | |||||
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 24 | import "frameworks/base/cmds/statsd/src/atoms.proto"; |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 25 | import "frameworks/base/cmds/statsd/src/stats_log_common.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 DimensionsValue { |
28 | optional int32 field = 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; | ||||
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 32 | int32 value_int = 3; |
33 | int64 value_long = 4; | ||||
34 | bool value_bool = 5; | ||||
35 | float value_float = 6; | ||||
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 36 | DimensionsValueTuple value_tuple = 7; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 37 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 38 | } |
39 | |||||
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 40 | message DimensionsValueTuple { |
41 | repeated DimensionsValue dimensions_value = 1; | ||||
42 | } | ||||
43 | |||||
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 44 | message EventMetricData { |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 45 | optional int64 elapsed_timestamp_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 46 | |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 47 | optional Atom atom = 2; |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 48 | |
49 | optional int64 wall_clock_timestamp_sec = 3; | ||||
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 50 | } |
51 | |||||
52 | message CountBucketInfo { | ||||
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 53 | optional int64 start_bucket_elapsed_nanos = 1; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 54 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 55 | optional int64 end_bucket_elapsed_nanos = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 56 | |
57 | optional int64 count = 3; | ||||
58 | } | ||||
59 | |||||
60 | message CountMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 61 | optional DimensionsValue dimensions_in_what = 1; |
62 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 63 | optional DimensionsValue dimensions_in_condition = 2; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 64 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 65 | repeated CountBucketInfo bucket_info = 3; |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 66 | } |
67 | |||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 68 | message DurationBucketInfo { |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 69 | optional int64 start_bucket_elapsed_nanos = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 70 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 71 | optional int64 end_bucket_elapsed_nanos = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 72 | |
73 | optional int64 duration_nanos = 3; | ||||
74 | } | ||||
75 | |||||
76 | message DurationMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 77 | optional DimensionsValue dimensions_in_what = 1; |
78 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 79 | optional DimensionsValue dimensions_in_condition = 2; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 80 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 81 | repeated DurationBucketInfo bucket_info = 3; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 82 | } |
83 | |||||
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 84 | message ValueBucketInfo { |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 85 | optional int64 start_bucket_elapsed_nanos = 1; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 86 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 87 | optional int64 end_bucket_elapsed_nanos = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 88 | |
89 | optional int64 value = 3; | ||||
90 | } | ||||
91 | |||||
92 | message ValueMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 93 | optional DimensionsValue dimensions_in_what = 1; |
94 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 95 | optional DimensionsValue dimensions_in_condition = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 96 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 97 | repeated ValueBucketInfo bucket_info = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 98 | } |
99 | |||||
100 | message GaugeBucketInfo { | ||||
101 | optional int64 start_bucket_nanos = 1; | ||||
102 | |||||
103 | optional int64 end_bucket_nanos = 2; | ||||
104 | |||||
Yangster-mac | 34ea110 | 2018-01-29 12:40:55 -0800 | [diff] [blame] | 105 | repeated Atom atom = 3; |
106 | |||||
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 107 | repeated int64 elapsed_timestamp_nanos = 4; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 108 | } |
109 | |||||
110 | message GaugeMetricData { | ||||
Yangster-mac | 468ff04 | 2018-01-17 12:26:34 -0800 | [diff] [blame] | 111 | optional DimensionsValue dimensions_in_what = 1; |
112 | |||||
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 113 | optional DimensionsValue dimensions_in_condition = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 114 | |
Yangster-mac | 16fc72f | 2018-01-18 13:18:01 -0800 | [diff] [blame] | 115 | repeated GaugeBucketInfo bucket_info = 3; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 116 | } |
117 | |||||
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 118 | message StatsLogReport { |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 119 | optional int64 metric_id = 1; |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 120 | |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 121 | // Fields 2 and 3 are reserved. |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 122 | |
123 | message EventMetricDataWrapper { | ||||
124 | repeated EventMetricData data = 1; | ||||
125 | } | ||||
126 | message CountMetricDataWrapper { | ||||
127 | repeated CountMetricData data = 1; | ||||
128 | } | ||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 129 | message DurationMetricDataWrapper { |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 130 | repeated DurationMetricData data = 1; |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 131 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 132 | message ValueMetricDataWrapper { |
133 | repeated ValueMetricData data = 1; | ||||
134 | } | ||||
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 135 | |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 136 | message GaugeMetricDataWrapper { |
137 | repeated GaugeMetricData data = 1; | ||||
138 | } | ||||
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 139 | |
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 140 | oneof data { |
141 | EventMetricDataWrapper event_metrics = 4; | ||||
142 | CountMetricDataWrapper count_metrics = 5; | ||||
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 143 | DurationMetricDataWrapper duration_metrics = 6; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 144 | ValueMetricDataWrapper value_metrics = 7; |
145 | GaugeMetricDataWrapper gauge_metrics = 8; | ||||
yro | 00698da | 2017-09-15 10:06:40 -0700 | [diff] [blame] | 146 | } |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 147 | } |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 148 | |
149 | message ConfigMetricsReport { | ||||
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 150 | repeated StatsLogReport metrics = 1; |
151 | |||||
152 | optional UidMapping uid_map = 2; | ||||
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 153 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 154 | optional int64 last_report_elapsed_nanos = 3; |
David Chen | 1604957 | 2018-02-01 18:27:51 -0800 | [diff] [blame] | 155 | |
Yangster-mac | 330af58 | 2018-02-08 15:24:38 -0800 | [diff] [blame] | 156 | optional int64 current_report_elapsed_nanos = 4; |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 157 | } |
158 | |||||
159 | message ConfigMetricsReportList { | ||||
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 160 | message ConfigKey { |
161 | optional int32 uid = 1; | ||||
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 162 | optional int64 id = 2; |
Yangster | fa28aec | 2017-10-30 10:29:52 -0700 | [diff] [blame] | 163 | } |
164 | optional ConfigKey config_key = 1; | ||||
165 | |||||
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 166 | repeated ConfigMetricsReport reports = 2; |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 167 | } |