• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 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 package com.android.server.appsearch.external.localstorage;
18 
19 import android.annotation.NonNull;
20 import android.app.appsearch.stats.SchemaMigrationStats;
21 
22 import com.android.server.appsearch.external.localstorage.stats.CallStats;
23 import com.android.server.appsearch.external.localstorage.stats.InitializeStats;
24 import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
25 import com.android.server.appsearch.external.localstorage.stats.PutDocumentStats;
26 import com.android.server.appsearch.external.localstorage.stats.RemoveStats;
27 import com.android.server.appsearch.external.localstorage.stats.SearchStats;
28 import com.android.server.appsearch.external.localstorage.stats.SetSchemaStats;
29 
30 /**
31  * An interface for implementing client-defined logging AppSearch operations stats.
32  *
33  * <p>Any implementation needs to provide general information on how to log all the stats types.
34  * (e.g. {@link CallStats})
35  *
36  * <p>All implementations of this interface must be thread safe.
37  *
38  * @hide
39  */
40 public interface AppSearchLogger {
41     /** Logs {@link CallStats} */
logStats(@onNull CallStats stats)42     void logStats(@NonNull CallStats stats);
43 
44     /** Logs {@link PutDocumentStats} */
logStats(@onNull PutDocumentStats stats)45     void logStats(@NonNull PutDocumentStats stats);
46 
47     /** Logs {@link InitializeStats} */
logStats(@onNull InitializeStats stats)48     void logStats(@NonNull InitializeStats stats);
49 
50     /** Logs {@link SearchStats} */
logStats(@onNull SearchStats stats)51     void logStats(@NonNull SearchStats stats);
52 
53     /** Logs {@link RemoveStats} */
logStats(@onNull RemoveStats stats)54     void logStats(@NonNull RemoveStats stats);
55 
56     /** Logs {@link OptimizeStats} */
logStats(@onNull OptimizeStats stats)57     void logStats(@NonNull OptimizeStats stats);
58 
59     /** Logs {@link SetSchemaStats} */
logStats(@onNull SetSchemaStats stats)60     void logStats(@NonNull SetSchemaStats stats);
61 
62     /** Logs {@link SchemaMigrationStats} */
logStats(@onNull SchemaMigrationStats stats)63     void logStats(@NonNull SchemaMigrationStats stats);
64 
65     // TODO(b/173532925) Add remaining logStats once we add all the stats.
66 }
67