/* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ syntax = "proto2"; package android.os.statsd.appsearch; import "frameworks/proto_logging/stats/atom_field_options.proto"; import "frameworks/proto_logging/stats/atoms.proto"; import "frameworks/proto_logging/stats/enums/appsearch/enums.proto"; option java_package = "com.android.os.appsearch"; option java_multiple_files = true; extend Atom { // Pushed atoms optional AppSearchSetSchemaStatsReported app_search_set_schema_stats_reported = 385 [(module) = "appsearch"]; optional AppSearchSchemaMigrationStatsReported app_search_schema_migration_stats_reported = 579 [(module) = "appsearch"]; optional AppSearchUsageSearchIntentStatsReported app_search_usage_search_intent_stats_reported = 825 [(module) = "appsearch"]; optional AppSearchUsageSearchIntentRawQueryStatsReported app_search_usage_search_intent_raw_query_stats_reported = 826 [(module) = "appsearch", (restriction_category) = RESTRICTION_SYSTEM_INTELLIGENCE]; } /** * Logs detailed stats for setting schema in AppSearch. * * stats pushed from: * frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java * * Next tag: 26 */ message AppSearchSetSchemaStatsReported { // The sampling interval for this specific type of stats // For example, sampling_interval=10 means that one out of every 10 stats was logged. optional int32 sampling_interval = 1; // # of previous skipped sample for this specific type of stats // We can't push atoms too closely, so some samples might be skipped // In order to extrapolate the counts, we need to save the number of skipped stats and add it back // For example, the true count of an event could be estimated as: // SUM(sampling_interval * (num_skipped_sample + 1)) as est_count optional int32 num_skipped_sample = 2; // Package UID of the application. optional int32 uid = 3 [(is_uid) = true]; // Hash of the database name within AppSearch optional int32 database = 4; // Needs to be sync with AppSearchResult#ResultCode in // frameworks/base/apex/appsearch/framework/java/android/app/appsearch/AppSearchResult.java optional int32 status_code = 5; // Overall time used for setting schema including the binder latency optional int32 total_latency_millis = 6; // Number of newly added schema types optional int32 new_type_count = 7; // Number of deleted schema types optional int32 deleted_type_count = 8; // Number of compatible schema type changes optional int32 compatible_type_change_count = 9; // Number of index-incompatible schema type changes optional int32 index_incompatible_type_change_count = 10; // Number of backwards-incompatible schema type changes optional int32 backwards_incompatible_type_change_count = 11; // Time used for verifying the incoming call. optional int32 verify_incoming_call_latency_millis = 12; // Time used for creating or waiting the user executor. optional int32 executor_acquisition_latency_millis = 13; // Time used for rebuilding objects from bundles. optional int32 rebuild_from_bundle_latency_millis = 14; // Time passed while waiting to acquire the lock during Java function calls. optional int32 java_lock_acquisition_latency_millis = 15; // Time used for the rewrite schema to proto. optional int32 rewrite_schema_latency_millis = 16; // Overall time used for the native function call. optional int32 total_native_latency_millis = 17; // Time used for the apply visibility settings function call. optional int32 visibility_setting_latency_millis = 18; // Time used for the dispatch change notification function call. optional int32 dispatch_change_notifications_latency_millis = 19; // Time used for the optimization function call. optional int32 optimize_latency_millis = 20; /** Whether this package is observed. */ optional bool is_package_observed = 21; /** Time used for the get old schema. */ optional int32 get_old_schema_latency_millis = 22; /** Time used for the get registered observer function call. */ optional int32 get_observer_latency_millis = 23; /** Time used for the preparing change notification action. */ optional int32 preparing_change_notification_latency_millis = 24; // Type of the SetSchema call relative to SchemaMigration case. // This is in sync with // packages/modules/AppSearch/service/java/com/android/server/appsearch/external/localstorage/stats/SetSchemaStats.java optional int32 schema_migration_call_type = 25; } /** * Logs detailed stats for schema migration in AppSearch. * * stats pushed from: * packages/modules/AppSearch/service/java/com/android/server/appsearch/AppSearchManagerService.java * * Next tag: 15 */ message AppSearchSchemaMigrationStatsReported { // The sampling interval for this specific type of stats // For example, sampling_interval=10 means that one out of every 10 stats was logged. optional int32 sampling_interval = 1; // # of previous skipped sample for this specific type of stats // We can't push atoms too closely, so some samples might be skipped // In order to extrapolate the counts, we need to save the number of skipped stats and add it back // For example, the true count of an event could be estimated as: // SUM(sampling_interval * (num_skipped_sample + 1)) as est_count optional int32 num_skipped_sample = 2; // Package UID of the application. optional int32 uid = 3 [(is_uid) = true]; // Hash of the database name within AppSearch optional int32 database = 4; // Needs to be sync with AppSearchResult#ResultCode in // packages/modules/AppSearch/framework/java/external/android/app/appsearch/AppSearchResult.java optional int32 status_code = 5; // Overall time used for setting schema including the binder latency optional int32 total_latency_millis = 6; // Overall time used for getting schema during schema migration optional int32 schema_migration_get_schema_latency_millis = 7; // Overall time used for querying and transforming documents during schema migration optional int32 schema_migration_query_and_transform_latency_millis = 8; // Overall time used for first setSchema during schema migration optional int32 schema_migration_first_set_schema_latency_millis = 9; // Overall time used for second setSchema during schema migration optional int32 schema_migration_second_set_schema_latency_millis = 10; // Overall time used for saving documents during schema migration optional int32 schema_migration_save_document_latency_millis = 11; // Number of document that need to be migrated to another version optional int32 total_need_migrated_document_count = 12; // Number of successfully migrated and saved in Icing optional int32 total_success_migrated_document_count = 13; // Number of migration failure during schema migration optional int32 schema_migration_failure_count = 14; } /** * Usage detailed stats (excluding raw query string) for search intent in AppSearch. * * stats pushed from: * frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java * * Next tag: 10 */ message AppSearchUsageSearchIntentStatsReported { // Package UID of the application. optional int32 uid = 1 [(is_uid) = true]; // Hash of the database name within AppSearch. optional int32 database = 2; // Timestamp of search request issued by the client. optional int64 search_intent_timestamp_millis = 3; // How many result documents being fetched in this search intent. optional int32 num_results_fetched = 4; // The correction type of the query in this search intent compared with the previous search // intent. optional android.appsearch.QueryCorrectionType query_correction_type = 5; // The following fields with prefix "clicks_" contain numbers (e.g. timestamp, rank) for all // clicks associated with the search intent. // Due to statsd restriction, we have to separate them into multiple repeated fields with // primitive type. repeated int64 clicks_timestamp_millis = 6; repeated int64 clicks_time_stay_on_result_millis = 7; repeated int32 clicks_result_rank_in_block = 8; repeated int32 clicks_result_rank_global = 9; } /** * Privacy preserved usage detailed stats (including raw query strings) for search intent in * AppSearch. * * stats pushed from: * frameworks/base/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java * * Next tag: 9 */ message AppSearchUsageSearchIntentRawQueryStatsReported { // Package name of the application. optional string package_name = 1; // Hash of the database name within AppSearch. optional int32 database = 2; // Raw query string of the previous search intent. optional string prev_query = 3 [(field_restriction_option).system_search = true]; // Raw query string of the current search intent. optional string curr_query = 4 [(field_restriction_option).system_search = true]; // How many result documents being fetched in this search intent. optional int32 num_results_fetched = 5; // How many click actions being taken in this search intent. optional int32 num_clicks = 6; // How many good click actions (i.e. the user stays on the clicked results for reasonable time) // being taken in this search intent. optional int32 num_good_clicks = 7; // The correction type of the query in this search intent compared with the previous search // intent. optional android.appsearch.QueryCorrectionType query_correction_type = 8; }