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