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; |
Paul Hu | 600bd89 | 2023-08-09 17:05:29 +0800 | [diff] [blame] | 64 | |
| 65 | // Record sent query count before stopped discovery |
| 66 | optional int32 sent_query_count = 12; |
Frank Li | e6b47f3 | 2022-10-25 18:57:10 +0000 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Logs the number of network count on each list of transports |
| 71 | * |
| 72 | * Logs from: |
| 73 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 74 | */ |
| 75 | message NetworkCountPerTransports { |
| 76 | // the number of network count on each list of transports |
| 77 | repeated NetworkCountForTransports network_count_for_transports = 1; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Logs the number of network count and transport type |
| 82 | * |
| 83 | * Logs from: |
| 84 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 85 | */ |
| 86 | message NetworkCountForTransports { |
| 87 | // Transport types of the network |
| 88 | optional int32 transport_types = 1; |
| 89 | |
| 90 | // Number of networks for one list of transport types |
| 91 | optional int32 network_count = 2; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Logs a list of networks |
| 96 | * |
| 97 | * Logs from: |
| 98 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 99 | */ |
| 100 | message NetworkList { |
| 101 | repeated NetworkDescription network_description = 1; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Logs connection duration in seconds and list of transports |
| 106 | * |
| 107 | * Logs from: |
| 108 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 109 | */ |
| 110 | message ConnectionDurationForTransports { |
| 111 | // Transport types of the network |
| 112 | optional int32 transport_types = 1; |
| 113 | |
| 114 | // Time duration that the device stays connected to the network |
| 115 | optional int32 duration_sec = 2; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Logs connection duration on each list of transports, in seconds |
| 120 | * |
| 121 | * Logs from: |
| 122 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 123 | */ |
| 124 | message ConnectionDurationPerTransports { |
| 125 | repeated ConnectionDurationForTransports connection_duration_for_transports = 1; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Logs network request count & request type |
| 130 | * |
| 131 | * Logs from: |
| 132 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 133 | */ |
| 134 | message RequestCountForType { |
| 135 | // The type of network request |
| 136 | optional .android.stats.connectivity.RequestType request_type = 1; |
| 137 | |
| 138 | // Number of network requests |
| 139 | optional int32 request_count = 2; |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Logs network request count |
| 144 | * |
| 145 | * Logs from: |
| 146 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 147 | */ |
| 148 | message NetworkRequestCount { |
| 149 | // Network request count for request type |
| 150 | repeated RequestCountForType request_count_for_type = 1; |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * Logs information about a network |
| 155 | * |
| 156 | * Logs from: |
| 157 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 158 | */ |
| 159 | message NetworkDescription { |
| 160 | // The transport types of the network. A network may include multiple transport types. |
| 161 | // Each transfer type is represented by a different bit, defined in |
| 162 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 163 | optional int32 transport_types = 1; |
| 164 | |
| 165 | // Indicates the network is metered, non-metered or temporarily-unmetered |
| 166 | optional .android.stats.connectivity.MeteredState metered_state = 2; |
| 167 | |
| 168 | // Indicates the network is validated, non-validated, partial or portal |
| 169 | optional .android.stats.connectivity.ValidatedState validated_state = 3; |
| 170 | |
| 171 | // Record the bitmask of all the policies applied to this score of network. |
| 172 | // Each policy is represented by a different bit, defined in |
| 173 | // packages/modules/Connectivity/service/src/com/android/server/connectivity/FullScore.java |
| 174 | optional int64 score_policies = 4; |
| 175 | |
| 176 | // The capabilities of the network. A network may include multiple network capabilities. |
| 177 | // Each capability is represented by a different bit, defined in |
| 178 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 179 | optional int64 capabilities = 5; |
| 180 | |
| 181 | // Bitfield representing the network's enterprise capability identifier, defined in |
| 182 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 183 | optional int32 enterprise_id = 6; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Pulls a list of NumberOfRematchesPerReason. |
| 188 | * |
| 189 | * Pulled from: |
| 190 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 191 | */ |
| 192 | message NumberOfRematchesPerReason { |
| 193 | // Number of network rematches for each rematch reason |
| 194 | repeated NumberOfRematchesForReason number_of_rematches_per_reason= 1; |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Logs number of network rematches for rematch reason |
| 199 | * |
| 200 | * Logs from: |
| 201 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 202 | */ |
| 203 | message NumberOfRematchesForReason { |
| 204 | // The reason of network rematch |
| 205 | optional .android.stats.connectivity.RematchReason rematch_reason = 1; |
| 206 | |
| 207 | // Number of network rematches |
| 208 | optional int32 rematch_count = 2; |
| 209 | }; |
| 210 | |
| 211 | /** |
| 212 | * Pulls information for connectivity stats. |
| 213 | * |
| 214 | * Pulled from: |
| 215 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 216 | */ |
| 217 | message ConnectivityStateSample { |
| 218 | // Number of networks per list of transports |
| 219 | optional NetworkCountPerTransports network_count_per_transports = 1; |
| 220 | |
| 221 | // This is a list of networks with their transports and the duration |
| 222 | optional ConnectionDurationPerTransports connection_duration_per_transports = 2; |
| 223 | |
| 224 | // Number of requests per category |
| 225 | optional NetworkRequestCount network_request_count = 3; |
| 226 | |
| 227 | // Full list of network details (slice by transport / meteredness / internet+validated) |
| 228 | optional NetworkList networks = 4; |
| 229 | } |
| 230 | |
| 231 | |
| 232 | /** |
| 233 | * Pulls information for network selection rematch info. |
| 234 | * |
| 235 | * Pulled from: |
| 236 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 237 | */ |
| 238 | message NetworkSelectionRematchReasonsInfo { |
| 239 | // Number of rematch per rematch reason |
| 240 | optional NumberOfRematchesPerReason number_of_rematches_per_reason = 1; |
| 241 | } |
| 242 | |
| 243 | /** |
| 244 | * Logs rematch information for the default network |
| 245 | * |
| 246 | * Logs from: |
| 247 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 248 | */ |
| 249 | message DefaultNetworkRematchInfo { |
| 250 | // The session id comes from each reboot, this is used to correlate the statistics of the |
| 251 | // networkselect on the same boot |
| 252 | optional int64 session_id = 1; |
| 253 | |
| 254 | // The information of old device default network |
| 255 | optional NetworkDescription old_network = 2; |
| 256 | |
| 257 | // The information of new device default network |
| 258 | optional NetworkDescription new_network = 3; |
| 259 | |
| 260 | // The reason of network rematch |
| 261 | optional .android.stats.connectivity.RematchReason rematch_reason = 4; |
| 262 | |
| 263 | // The time duration the device kept the old network as the default in seconds |
| 264 | optional int32 time_duration_on_old_network_sec = 5; |
| 265 | } |
| 266 | |
| 267 | /** |
| 268 | * Logs network selection performance |
| 269 | * |
| 270 | * Logs from: |
| 271 | * packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java |
| 272 | */ |
| 273 | message NetworkSelectionPerformance { |
| 274 | // Number of network requests |
| 275 | optional int32 number_of_network_requests = 1; |
| 276 | |
| 277 | // List of networks right now |
| 278 | // (slice by transport / meteredness / internet+validated) |
| 279 | optional NetworkList networks = 2; |
| 280 | |
| 281 | // The latency of selection computed in milli-second |
| 282 | optional int32 selection_computed_latency_milli = 3; |
| 283 | |
| 284 | // The latency of selection applied in milli-second |
| 285 | optional int32 selection_applied_latency_milli = 4; |
| 286 | |
| 287 | // The latency of selection issued in milli-second |
| 288 | optional int32 selection_issued_latency_milli = 5; |
| 289 | } |
Frank Li | 0423658 | 2023-03-01 16:50:47 +0000 | [diff] [blame] | 290 | |
| 291 | message NetworkSliceRequestCountSample { |
| 292 | // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY), |
| 293 | // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 294 | optional int64 slice_id = 1; |
| 295 | |
| 296 | // Bitfield representing the network's enterprise capability identifier |
| 297 | // (e.g. NET_ENTERPRISE_ID_1), defined in |
| 298 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 299 | optional int32 enterprise_id = 2; |
| 300 | |
| 301 | // number of request for this slice |
| 302 | optional int32 request_count = 3; |
| 303 | |
| 304 | // number of apps with outstanding request(s) for this slice |
| 305 | optional int32 distinct_app_count = 4; |
| 306 | } |
| 307 | |
| 308 | message NetworkSliceSessionEnded { |
| 309 | // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY), |
| 310 | // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 311 | optional int64 slice_id = 1; |
| 312 | |
| 313 | // Bitfield representing the network's enterprise capability identifier |
| 314 | // (e.g. NET_ENTERPRISE_ID_1), defined in |
| 315 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 316 | optional int32 enterprise_id = 2; |
| 317 | |
| 318 | // Number of bytes received at the device on this slice id |
| 319 | optional int64 rx_bytes = 3; |
| 320 | |
| 321 | // Number of bytes transmitted by the device on this slice id |
| 322 | optional int64 tx_bytes = 4; |
| 323 | |
| 324 | // Number of apps that have used this slice |
| 325 | optional int32 number_of_apps = 5; |
| 326 | |
| 327 | // How long(in seconds) this slice has been connected |
| 328 | optional int32 slice_connection_duration_sec = 6; |
| 329 | } |
| 330 | |
| 331 | message NetworkSliceDailyDataUsageReported { |
| 332 | // Bitfield representing the network's capability(e.g. NET_CAPABILITY_PRIORITIZE_LATENCY), |
| 333 | // defined in packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 334 | optional int64 slice_id = 1; |
| 335 | |
| 336 | // Bitfield representing the network's enterprise capability identifier |
| 337 | // (e.g. NET_ENTERPRISE_ID_1), defined in |
| 338 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 339 | optional int32 enterprise_id = 2; |
| 340 | |
| 341 | // Number of bytes received at the device on this slice id |
| 342 | optional int64 rx_bytes = 3; |
| 343 | |
| 344 | // Number of bytes transmitted by the device on this slice id |
| 345 | optional int64 tx_bytes = 4; |
| 346 | |
| 347 | // Number of apps that have used this slice |
| 348 | optional int32 number_of_apps = 5; |
| 349 | |
| 350 | // How long(in seconds) this slice has been connected |
| 351 | optional int32 slice_connection_duration_sec = 6; |
| 352 | } |
Frank Li | d5c936b | 2023-03-17 00:43:34 +0000 | [diff] [blame] | 353 | |
| 354 | /** |
| 355 | * Logs DailykeepaliveInfoReported |
| 356 | * |
| 357 | * Logs from: packages/modules/Connectivity/service/src/com/android/ |
| 358 | * server/connectivity/AutomaticOnOffKeepaliveTracker. |
| 359 | */ |
| 360 | message DailykeepaliveInfoReported{ |
| 361 | // Daily duration per number of concurrent keepalive |
| 362 | optional DurationPerNumOfKeepalive duration_per_num_of_keepalive = 1; |
| 363 | |
| 364 | // Daily keepalive registered/active duration on each list of keepalive session, in |
| 365 | // milli-seconds |
| 366 | optional KeepaliveLifetimePerCarrier keepalive_lifetime_per_carrier = 2; |
| 367 | |
| 368 | // Daily number of keepalive requests |
| 369 | optional int32 keepalive_requests = 3; |
| 370 | |
| 371 | // Daily number of automatic keepalive requests |
| 372 | optional int32 automatic_keepalive_requests = 4; |
| 373 | |
| 374 | // Daily number of distinct apps that requested keepalives |
| 375 | optional int32 distinct_user_count = 5; |
| 376 | |
| 377 | // Daily distinct apps uid list that requested keepalives |
| 378 | repeated int32 uid = 6; |
| 379 | } |
| 380 | |
| 381 | /** |
| 382 | * Daily duration per number of concurrent keepalive |
| 383 | * |
| 384 | * Logs from: packages/modules/Connectivity/service/src/com/android/ |
| 385 | * server/connectivity/AutomaticOnOffKeepaliveTracker. |
| 386 | */ |
| 387 | message DurationPerNumOfKeepalive { |
| 388 | repeated DurationForNumOfKeepalive duration_for_num_of_keepalive = 1; |
| 389 | } |
| 390 | |
| 391 | message DurationForNumOfKeepalive { |
| 392 | // The number of concurrent keepalives is in the device |
| 393 | optional int32 num_of_keepalive = 1; |
| 394 | |
| 395 | // How many milliseconds the device has keepalive registration number is num_of_keepalive |
| 396 | optional int32 keepalive_registered_durations_msec = 2; |
| 397 | |
| 398 | // How many milliseconds the device has keepalive active(not paused) number is num_of_keepalive |
| 399 | optional int32 keepalive_active_durations_msec = 3; |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * Daily keepalive registered/active duration on each list of Keepalive session, in milli-seconds |
| 404 | * |
| 405 | * Logs from: packages/modules/Connectivity/service/src/com/android/ |
| 406 | * server/connectivity/AutomaticOnOffKeepaliveTracker. |
| 407 | */ |
| 408 | message KeepaliveLifetimePerCarrier { |
| 409 | // The number of network count on each list of carriers |
| 410 | repeated KeepaliveLifetimeForCarrier keepalive_lifetime_for_carrier = 1; |
| 411 | } |
| 412 | |
| 413 | /** |
| 414 | * Logs the keepalive registered/active duration in milli-seconds and carrier |
| 415 | * info(carrier id, transport, keepalive interval). |
| 416 | * |
| 417 | * Logs from: packages/modules/Connectivity/service/src/com/android/ |
| 418 | * server/connectivity/AutomaticOnOffKeepaliveTracker. |
| 419 | */ |
| 420 | message KeepaliveLifetimeForCarrier { |
| 421 | // The carrier ID for each keepalive, or TelephonyManager.UNKNOWN_CARRIER_ID(-1) if not cell |
| 422 | optional int32 carrier_id = 1; |
| 423 | |
| 424 | // The transport types of the underlying network for each keepalive. A network may include |
| 425 | // multiple transport types. Each transfer type is represented by a different bit, defined in |
| 426 | // packages/modules/Connectivity/framework/src/android/net/NetworkCapabilities.java |
| 427 | optional int32 transport_types = 2; |
| 428 | |
| 429 | // The keepalive interval for each keepalive |
| 430 | optional int32 intervals_msec = 3; |
| 431 | |
| 432 | // The lifetime of the keepalive registered today |
| 433 | optional int32 lifetime_msec = 4; |
| 434 | |
| 435 | // The duration for which the keepalive was active (not suspended) |
| 436 | optional int32 active_lifetime_msec = 5; |
| 437 | } |
| 438 | |