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