Frank Li | e6b47f3 | 2022-10-25 18:57:10 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | syntax = "proto2"; |
| 18 | option java_multiple_files = true; |
| 19 | |
| 20 | package com.android.metrics; |
| 21 | |
| 22 | import "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 | */ |
| 30 | message 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 | */ |
| 72 | message 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 | */ |
| 83 | message 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 | */ |
| 97 | message 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 | */ |
| 107 | message 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 | */ |
| 121 | message 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 | */ |
| 131 | message 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 | */ |
| 145 | message 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 | */ |
| 156 | message 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 | */ |
| 189 | message 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 | */ |
| 200 | message 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 | */ |
| 214 | message 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 | */ |
| 235 | message 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 | */ |
| 246 | message 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 | */ |
| 270 | message 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 | } |
Frank Li | 0423658 | 2023-03-01 16:50:47 +0000 | [diff] [blame^] | 287 | |
| 288 | message NetworkSliceRequestCountSample { |
| 289 | // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY), |
| 290 | // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 291 | optional int64 slice_id = 1; |
| 292 | |
| 293 | // Bitfield representing the network's enterprise capability identifier |
| 294 | // (e.g. NET_ENTERPRISE_ID_1), defined in |
| 295 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 296 | optional int32 enterprise_id = 2; |
| 297 | |
| 298 | // number of request for this slice |
| 299 | optional int32 request_count = 3; |
| 300 | |
| 301 | // number of apps with outstanding request(s) for this slice |
| 302 | optional int32 distinct_app_count = 4; |
| 303 | } |
| 304 | |
| 305 | message NetworkSliceSessionEnded { |
| 306 | // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY), |
| 307 | // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 308 | optional int64 slice_id = 1; |
| 309 | |
| 310 | // Bitfield representing the network's enterprise capability identifier |
| 311 | // (e.g. NET_ENTERPRISE_ID_1), defined in |
| 312 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 313 | optional int32 enterprise_id = 2; |
| 314 | |
| 315 | // Number of bytes received at the device on this slice id |
| 316 | optional int64 rx_bytes = 3; |
| 317 | |
| 318 | // Number of bytes transmitted by the device on this slice id |
| 319 | optional int64 tx_bytes = 4; |
| 320 | |
| 321 | // Number of apps that have used this slice |
| 322 | optional int32 number_of_apps = 5; |
| 323 | |
| 324 | // How long(in seconds) this slice has been connected |
| 325 | optional int32 slice_connection_duration_sec = 6; |
| 326 | } |
| 327 | |
| 328 | message NetworkSliceDailyDataUsageReported { |
| 329 | // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY), |
| 330 | // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 331 | optional int64 slice_id = 1; |
| 332 | |
| 333 | // Bitfield representing the network's enterprise capability identifier |
| 334 | // (e.g. NET_ENTERPRISE_ID_1), defined in |
| 335 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 336 | optional int32 enterprise_id = 2; |
| 337 | |
| 338 | // Number of bytes received at the device on this slice id |
| 339 | optional int64 rx_bytes = 3; |
| 340 | |
| 341 | // Number of bytes transmitted by the device on this slice id |
| 342 | optional int64 tx_bytes = 4; |
| 343 | |
| 344 | // Number of apps that have used this slice |
| 345 | optional int32 number_of_apps = 5; |
| 346 | |
| 347 | // How long(in seconds) this slice has been connected |
| 348 | optional int32 slice_connection_duration_sec = 6; |
| 349 | } |