blob: 48b8316dcb8e74030ad4efbbc2a194e75cf8c074 [file] [log] [blame]
Frank Lie6b47f32022-10-25 18:57:10 +00001/*
2 * Copyright (C) 2022 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 */
16
17syntax = "proto2";
18option java_multiple_files = true;
19
20package com.android.metrics;
21
22import "frameworks/proto_logging/stats/enums/stats/connectivity/connectivity_service.proto";
23
24/**
25 * Logs NSD(Network service discovery) client session
26 *
27 * Log from:
28 * packages/modules/Connectivity/service-t/src/com/android/server/NsdService
29 */
30message NetworkNsdReported {
31 // Indicate if the device is using the legacy or the new implementation
32 optional bool is_legacy = 1;
33
34 // It is a random number to represent different clients. Each client is an app on the device.
35 optional int32 client_id = 2;
36
37 // It is a increment_number to represent different transactions.
38 // Each transaction is a request from an app client.
39 optional int32 transaction_id = 3;
40
41 // Indicate the service in resolution is a known service in the discovered services cache
42 optional bool is_known_service = 4;
43
44 // Record each NSD session type
45 optional .android.stats.connectivity.NsdEventType type = 5;
46
47 // The process duration of the event in milli-second
48 optional int64 event_duration_millisec = 6;
49
50 // Record each mdns query result
51 optional .android.stats.connectivity.MdnsQueryResult query_result = 7;
52
53 // Count of services in cache at the end of discovery
54 optional int32 found_service_count = 8;
55
56 // Count of found callback when discovery is stopped
57 optional int32 found_callback_count = 9;
58
59 // Count of lost callback when discovery is stopped
60 optional int32 lost_callback_count = 10;
61
62 // Record query service count before unregistered service
63 optional int32 replied_requests_count = 11;
64}
65
66/**
67 * Logs the number of network count on each list of transports
68 *
69 * Logs from:
70 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
71 */
72message NetworkCountPerTransports {
73 // the number of network count on each list of transports
74 repeated NetworkCountForTransports network_count_for_transports = 1;
75}
76
77/**
78 * Logs the number of network count and transport type
79 *
80 * Logs from:
81 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
82 */
83message NetworkCountForTransports {
84 // Transport types of the network
85 optional int32 transport_types = 1;
86
87 // Number of networks for one list of transport types
88 optional int32 network_count = 2;
89}
90
91/**
92 * Logs a list of networks
93 *
94 * Logs from:
95 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
96 */
97message NetworkList {
98 repeated NetworkDescription network_description = 1;
99}
100
101/**
102 * Logs connection duration in seconds and list of transports
103 *
104 * Logs from:
105 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
106 */
107message ConnectionDurationForTransports {
108 // Transport types of the network
109 optional int32 transport_types = 1;
110
111 // Time duration that the device stays connected to the network
112 optional int32 duration_sec = 2;
113}
114
115/**
116 * Logs connection duration on each list of transports, in seconds
117 *
118 * Logs from:
119 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
120 */
121message ConnectionDurationPerTransports {
122 repeated ConnectionDurationForTransports connection_duration_for_transports = 1;
123}
124
125/**
126 * Logs network request count & request type
127 *
128 * Logs from:
129 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
130 */
131message RequestCountForType {
132 // The type of network request
133 optional .android.stats.connectivity.RequestType request_type = 1;
134
135 // Number of network requests
136 optional int32 request_count = 2;
137}
138
139/**
140 * Logs network request count
141 *
142 * Logs from:
143 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
144 */
145message NetworkRequestCount {
146 // Network request count for request type
147 repeated RequestCountForType request_count_for_type = 1;
148}
149
150/**
151 * Logs information about a network
152 *
153 * Logs from:
154 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
155 */
156message NetworkDescription {
157 // The transport types of the network. A network may include multiple transport types.
158 // Each transfer type is represented by a different bit, defined in
159 // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
160 optional int32 transport_types = 1;
161
162 // Indicates the network is metered, non-metered or temporarily-unmetered
163 optional .android.stats.connectivity.MeteredState metered_state = 2;
164
165 // Indicates the network is validated, non-validated, partial or portal
166 optional .android.stats.connectivity.ValidatedState validated_state = 3;
167
168 // Record the bitmask of all the policies applied to this score of network.
169 // Each policy is represented by a different bit, defined in
170 // packages/modules/Connectivity/service/src/com/android/server/connectivity/FullScore.java
171 optional int64 score_policies = 4;
172
173 // The capabilities of the network. A network may include multiple network capabilities.
174 // Each capability is represented by a different bit, defined in
175 // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
176 optional int64 capabilities = 5;
177
178 // Bitfield representing the network's enterprise capability identifier, defined in
179 // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java
180 optional int32 enterprise_id = 6;
181}
182
183/**
184 * Pulls a list of NumberOfRematchesPerReason.
185 *
186 * Pulled from:
187 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
188 */
189message NumberOfRematchesPerReason {
190 // Number of network rematches for each rematch reason
191 repeated NumberOfRematchesForReason number_of_rematches_per_reason= 1;
192}
193
194/**
195 * Logs number of network rematches for rematch reason
196 *
197 * Logs from:
198 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
199 */
200message NumberOfRematchesForReason {
201 // The reason of network rematch
202 optional .android.stats.connectivity.RematchReason rematch_reason = 1;
203
204 // Number of network rematches
205 optional int32 rematch_count = 2;
206};
207
208/**
209 * Pulls information for connectivity stats.
210 *
211 * Pulled from:
212 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
213 */
214message ConnectivityStateSample {
215 // Number of networks per list of transports
216 optional NetworkCountPerTransports network_count_per_transports = 1;
217
218 // This is a list of networks with their transports and the duration
219 optional ConnectionDurationPerTransports connection_duration_per_transports = 2;
220
221 // Number of requests per category
222 optional NetworkRequestCount network_request_count = 3;
223
224 // Full list of network details (slice by transport / meteredness / internet+validated)
225 optional NetworkList networks = 4;
226}
227
228
229/**
230 * Pulls information for network selection rematch info.
231 *
232 * Pulled from:
233 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
234 */
235message NetworkSelectionRematchReasonsInfo {
236 // Number of rematch per rematch reason
237 optional NumberOfRematchesPerReason number_of_rematches_per_reason = 1;
238}
239
240/**
241 * Logs rematch information for the default network
242 *
243 * Logs from:
244 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
245 */
246message DefaultNetworkRematchInfo {
247 // The session id comes from each reboot, this is used to correlate the statistics of the
248 // networkselect on the same boot
249 optional int64 session_id = 1;
250
251 // The information of old device default network
252 optional NetworkDescription old_network = 2;
253
254 // The information of new device default network
255 optional NetworkDescription new_network = 3;
256
257 // The reason of network rematch
258 optional .android.stats.connectivity.RematchReason rematch_reason = 4;
259
260 // The time duration the device kept the old network as the default in seconds
261 optional int32 time_duration_on_old_network_sec = 5;
262}
263
264/**
265 * Logs network selection performance
266 *
267 * Logs from:
268 * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
269 */
270message NetworkSelectionPerformance {
271 // Number of network requests
272 optional int32 number_of_network_requests = 1;
273
274 // List of networks right now
275 // (slice by transport / meteredness / internet+validated)
276 optional NetworkList networks = 2;
277
278 // The latency of selection computed in milli-second
279 optional int32 selection_computed_latency_milli = 3;
280
281 // The latency of selection applied in milli-second
282 optional int32 selection_applied_latency_milli = 4;
283
284 // The latency of selection issued in milli-second
285 optional int32 selection_issued_latency_milli = 5;
286}