diff options
author | Hao Liu <haoliuu@google.com> | 2023-10-03 16:15:34 +0000 |
---|---|---|
committer | Hao Liu <haoliuu@google.com> | 2023-10-17 15:52:02 +0000 |
commit | bc7ec3ff9db70e8a11310d548541d75c75acbce7 (patch) | |
tree | 767f4977b786fed5bdd95a15f8ee21befc7853ec /proto | |
parent | 824f349a0225e1a67e4cbbacd81e34755c1d8f97 (diff) | |
download | mobile-data-download-bc7ec3ff9db70e8a11310d548541d75c75acbce7.tar.gz |
Code dump with latest updates.
The updates include more MDD logging feature.
Test: atest MddJobServiceTest & AdServicesMddIntegrationTests | MobileDataDownloadRoboTests
Tested manually with MDD download job
Bug: 302700021
Change-Id: I887b59953b617e5e9436d119a8353f39db64769b
Diffstat (limited to 'proto')
-rw-r--r-- | proto/BUILD | 14 | ||||
-rw-r--r-- | proto/client_config.proto | 3 | ||||
-rw-r--r-- | proto/download_config.proto | 3 | ||||
-rw-r--r-- | proto/log_enums.proto | 109 | ||||
-rw-r--r-- | proto/logs.proto | 84 | ||||
-rw-r--r-- | proto/metadata.proto | 12 |
6 files changed, 207 insertions, 18 deletions
diff --git a/proto/BUILD b/proto/BUILD index 09df231..7b46203 100644 --- a/proto/BUILD +++ b/proto/BUILD @@ -2,7 +2,9 @@ load("//third_party/bazel_rules/rules_java/java:defs.bzl", "java_proto_library") package( default_applicable_licenses = ["//:license"], - default_visibility = ["//visibility:public"], + default_visibility = [ + "//visibility:public", + ], licenses = ["notice"], ) @@ -20,6 +22,11 @@ java_lite_proto_library( deps = [":client_config_proto"], ) +java_proto_library( + name = "client_config_java_proto", + deps = [":client_config_proto"], +) + proto_library( name = "download_config_proto", srcs = ["download_config.proto"], @@ -41,6 +48,11 @@ java_lite_proto_library( deps = [":download_config_proto"], ) +java_proto_library( + name = "download_config_java_proto", + deps = [":download_config_proto"], +) + proto_library( name = "transform_proto", srcs = ["transform.proto"], diff --git a/proto/client_config.proto b/proto/client_config.proto index f6260c7..e5c0034 100644 --- a/proto/client_config.proto +++ b/proto/client_config.proto @@ -13,11 +13,10 @@ // limitations under the License. syntax = "proto2"; -package com.google.android.libraries.mdi.download; +package com.google.android.libraries.mobiledatadownload; import "google/protobuf/any.proto"; -//option jspb_use_correct_proto2_semantics = false; // <internal> option java_package = "com.google.mobiledatadownload"; option java_outer_classname = "ClientConfigProto"; option objc_class_prefix = "ICN"; diff --git a/proto/download_config.proto b/proto/download_config.proto index 1b88c23..ec4478a 100644 --- a/proto/download_config.proto +++ b/proto/download_config.proto @@ -21,7 +21,6 @@ import "transform.proto"; option java_package = "com.google.mobiledatadownload"; option java_outer_classname = "DownloadConfigProto"; option objc_class_prefix = "Icing"; -//option go_api_flag = "OPEN_TO_OPAQUE_HYBRID"; // See <internal>. // The top-level proto for Mobile Data Download (<internal>). message DownloadConfig { @@ -530,8 +529,6 @@ message ManifestConfig { // prefix encoding, however, for the S2CellIds the high-order bits // encode the face-ID and as a result we often end up with large // numbers. -// optional fixed64 s2_cell_id = 1 [ -// (datapol.semantic_type) = ST_LOCATION optional fixed64 s2_cell_id = 1; } diff --git a/proto/log_enums.proto b/proto/log_enums.proto index a86c611..2f8d93c 100644 --- a/proto/log_enums.proto +++ b/proto/log_enums.proto @@ -43,13 +43,42 @@ message MddClientEvent { // Logged with DataDownloadFileGroupStats, MddFileGroupStatus. DATA_DOWNLOAD_FILE_GROUP_STATUS = 1044; + // MDD download result log. + DATA_DOWNLOAD_RESULT_LOG = 1068; + // Log MddStorageStats in daily maintenance. DATA_DOWNLOAD_STORAGE_STATS = 1055; - // MDD download result log. - DATA_DOWNLOAD_RESULT_LOG = 1068; + // Log event for MDD Lib api result. + DATA_DOWNLOAD_LIB_API_RESULT = 1108; + + // Log MddNetworkStats in daily maintenance. + DATA_DOWNLOAD_NETWORK_STATS = 1056; + + // File group download started. + DATA_DOWNLOAD_STARTED = 1070; - reserved 1000 to 1043, 1045 to 1054, 1056 to 1067, 1069 to 1113; + // File group download complete. + DATA_DOWNLOAD_COMPLETE = 1007; + + // The log event for MDD download latency. + DATA_DOWNLOAD_LATENCY_LOG = 1080; + + // All files in the group were already available when the file group was + // added. + DATA_DOWNLOAD_COMPLETE_IMMEDIATE = 1032; + + DATA_DOWNLOAD_PENDING_GROUP_REPLACED = 1115; + + reserved 1000 to 1006; + reserved 1008 to 1031; + reserved 1033 to 1043; + reserved 1045 to 1054; + reserved 1057 to 1067; + reserved 1069; + reserved 1071 to 1079; + reserved 1081 to 1107; + reserved 1109 to 1114; reserved 2000 to 2999, 3000 to 3999, 4000 to 4099, 4100 to 4199, 5000 to 5999, 6000 to 6999, 7000 to 7999, 8000 to 8999, 9000 to 9999, @@ -171,3 +200,77 @@ message MddDownloadResult { reserved 1000 to 3000; } } + +// Collection of MDD Lib's Public API methods used when logging the result of an +// MDD Lib API call. +message MddLibApiName { + enum Code { + UNKNOWN = 0; + + // File Group metadata management APIs. + // NOTE: These APIs will include DataDownloadFileGroupStats in their + // logs. + ADD_FILE_GROUP = 1; + GET_FILE_GROUP = 2; + REMOVE_FILE_GROUP = 3; + REPORT_USAGE = 4; + + // File Group data management APIs. + // NOTE: These APIs will include DataDownloadFileGroupStats in their + // logs. + CANCEL_FOREGROUND_DOWNLOAD = 5; + DOWNLOAD_FILE_GROUP = 6; + DOWNLOAD_FILE_GROUP_WITH_FOREGROUND_SERVICE = 7; + IMPORT_FILES = 8; + + // File Group metadata bulk management APIs + // NOTE: These APIs will not include DataDownloadFileGroupStats in + // their logs. + CLEAR = 9; + GET_FILE_GROUPS_BY_FILTER = 10; + MAINTENANCE = 11; + REMOVE_FILE_GROUPS_BY_FILTER = 12; + + // File data management APIs + // NOTE: These APIs will not include DataDownloadFileGroupStats in + // their logs. + DOWNLOAD_FILE = 13; + DOWNLOAD_FILE_WITH_FOREGROUND_SERVICE = 14; + + // Task scheduling APIs. + // NOTE: These APIs will not include DataDownloadFileGroupStats in + // their logs. + HANDLE_TASK = 15; + SCHEDULE_PERIODIC_BACKGROUND_TASKS = 16; + SYNC = 17; + + // Calls to phenotype external experiment id setting + + // NOTE: this isn't actually an MDD API but the data is in the same format. + // DataDownloadFileGroupStats will be populated when available. + PHENOTYPE_CLEAR_EXPERIMENT_IDS = 18; + PHENOTYPE_UPDATE_EXPERIMENT_IDS = 19; + PHENOTYPE_CLEAR_ALL = 20; + } +} + +// Result enum when logging the result of an MDD Lib API call. +message MddLibApiResult { + enum Code { + RESULT_UNKNOWN = 0; + RESULT_SUCCESS = 1; + + // Codes for failures + // Used for failures whose is reason is unknown. + RESULT_FAILURE = 2; + // Request cancelled + RESULT_CANCELLED = 3; + // Interrupted + RESULT_INTERRUPTED = 4; + RESULT_IO_ERROR = 5; + RESULT_ILLEGAL_STATE = 6; + RESULT_ILLEGAL_ARGUMENT = 7; + RESULT_UNSUPPORTED_OPERATION = 8; + RESULT_DOWNLOAD_ERROR = 9; + } +} diff --git a/proto/logs.proto b/proto/logs.proto index b35aa07..e3d6582 100644 --- a/proto/logs.proto +++ b/proto/logs.proto @@ -19,7 +19,6 @@ package mobiledatadownload.logs; import "log_enums.proto"; -//option jspb_use_correct_proto2_semantics = false; // <internal> option java_package = "com.google.mobiledatadownload"; option java_outer_classname = "LogProto"; @@ -182,8 +181,17 @@ message MddLogData { // MDD download result log. optional MddDownloadResultLog mdd_download_result_log = 63; - reserved 1 to 9, 11 to 20, 22 to 31, 33 to 39, 41 to 45, 47 to 50, 52 to 62, - 64 to 71, 73; + // MDD download latency log. + optional MddDownloadLatency mdd_download_latency = 67; + + // MDD Api Result event + optional MddLibApiResultLog mdd_lib_api_result_log = 71; + + // MDD File Group Network Stats. Additional info necessary for Network Stats. + optional MddNetworkStats mdd_network_stats = 49; + + reserved 1 to 9, 11 to 20, 22 to 31, 33 to 39, 41 to 45, 47 to 48, 50, + 52 to 62, 64 to 66, 68 to 70, 73; } // Info on sampling method used for log events. Stable sampling means if a @@ -268,4 +276,74 @@ message MddStorageStats { // // See <internal> for more info. optional int32 days_since_last_log = 6; +} + +// MDD download latency log. +// Next tag: 4 +message MddDownloadLatency { + // The number of download attempts needed to fully download the file group. + optional int32 download_attempt_count = 1; + // The download latency in milliseconds, which is the time elapsed between + // download started and download complete. + optional int64 download_latency_ms = 2; + // The total MDD download latency in milliseconds, which is the time elapsed + // between new config received from P/H and download complete. + // True E2E download latency = PH propagation latency + MDD total download + // latency. Here we are talking about the later. + optional int64 total_latency_ms = 3; +} + +// MDD Lib API result log. +// This log will be generated for each MDD Lib API call. +// +// Next tag: 5 +message MddLibApiResultLog { + // The API which generated this result. + optional MddLibApiName.Code api_used = 1; + + // The result of the API call. + optional MddLibApiResult.Code result = 2; + + // Will be populated with relevant file group details depending on the api + // type. See MddLibApiName for more details. + repeated DataDownloadFileGroupStats data_download_file_group_stats = 3; + + // The latency in nano seconds. + optional int64 latency_ns = 4; +} + +// MDD File Group Network stats. +message MddGroupNetworkStats { + optional DataDownloadFileGroupStats data_download_file_group_stats = 1; + + // The total bytes downloaded through Wifi by the file group. + optional int64 total_wifi_bytes = 2; + + // The total bytes downloaded through Cellular by the file group. + optional int64 total_cellular_bytes = 3; + + // The total bytes downloaded through ways other than wifi or Cellular by the + // file group. E.g. import from local storage & etc. + optional int64 total_other_bytes = 4; +} + +// MDD Network stats +message MddNetworkStats { + message GroupStats { + optional DataDownloadFileGroupStats data_download_file_group_stats = 1; + + // The total bytes downloaded through Wifi by the file group. + optional uint64 total_wifi_bytes = 2; + + // The total bytes downloaded through Cellular by the file group. + optional uint64 total_cellular_bytes = 3; + } + + repeated GroupStats group_stats = 1; + + // Total bytes downloaded by all MDD file groups through Wifi. + optional uint64 total_mdd_wifi_bytes = 2; + + // Total bytes downloaded by all MDD file groups through Cellular. + optional uint64 total_mdd_cellular_bytes = 3; }
\ No newline at end of file diff --git a/proto/metadata.proto b/proto/metadata.proto index 6e6d8dc..4082a40 100644 --- a/proto/metadata.proto +++ b/proto/metadata.proto @@ -573,21 +573,21 @@ message SharedFile { } // Metadata used by -// com.google.android.libraries.mdi.download.MobileDataDownloadManager +// com.google.android.libraries.mobiledatadownload.MobileDataDownloadManager message MobileDataDownloadManagerMetadata { optional bool mdd_migrated_to_offroad = 1; optional int32 reset_trigger = 2; } // Metadata used by -// com.google.android.libraries.mdi.download.SharedFileManager +// com.google.android.libraries.mobiledatadownload.SharedFileManager message SharedFileManagerMetadata { optional bool migrated_to_new_file_key = 1; optional int64 next_file_name = 2; } // Collects all data used by -// com.google.android.libraries.mdi.download.internal.Migrations +// com.google.android.libraries.mobiledatadownload.internal.Migrations message MigrationsStore { enum FileKeyVersion { NEW_FILE_KEY = 0; @@ -599,7 +599,7 @@ message MigrationsStore { } // Collects all data used by -// com.google.android.libraries.mdi.download.internal.FileGroupsMetadata +// com.google.android.libraries.mobiledatadownload.internal.FileGroupsMetadata message FileGroupsMetadataStore { // Key must be a serialized GroupKey. map<string, DataFileGroupInternal> data_file_groups = 1; @@ -609,7 +609,7 @@ message FileGroupsMetadataStore { } // Collects all data used by -// com.google.android.libraries.mdi.download.internal.SharedFilesMetadata +// com.google.android.libraries.mobiledatadownload.internal.SharedFilesMetadata message SharedFilesMetadataStore { // The key must be a serialized NewFileKey. map<string, SharedFile> shared_files = 1; @@ -641,7 +641,7 @@ message NewFileKey { optional string checksum = 3; optional DataFileGroupInternal.AllowedReaders allowed_readers = 4; optional mobstore.proto.Transforms download_transforms = 5 - [deprecated = true]; + [deprecated = true]; } // This proto is used to store state for logging. See details at |