Home
last modified time | relevance | path

Searched refs:CallStats (Results 1 – 18 of 18) sorted by relevance

/packages/modules/AppSearch/testing/servicestests/src/com/android/server/appsearch/
DAppSearchRateLimitConfigTest.java25 import com.android.server.appsearch.external.localstorage.stats.CallStats;
43 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_GET_NAMESPACES)).isEqualTo(1); in testDefaultRateLimitConfig()
44 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_SEARCH)).isEqualTo(1); in testDefaultRateLimitConfig()
45 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_GET_STORAGE_INFO)).isEqualTo(1); in testDefaultRateLimitConfig()
47 CallStats.CALL_TYPE_REMOVE_DOCUMENTS_BY_SEARCH)).isEqualTo(1); in testDefaultRateLimitConfig()
58 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_PUT_DOCUMENTS)).isEqualTo(5); in testCustomRateLimitConfig()
59 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_GET_DOCUMENTS)).isEqualTo(11); in testCustomRateLimitConfig()
60 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_SET_SCHEMA)).isEqualTo(99); in testCustomRateLimitConfig()
62 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_GET_NAMESPACES)).isEqualTo(1); in testCustomRateLimitConfig()
63 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_SEARCH)).isEqualTo(1); in testCustomRateLimitConfig()
[all …]
DDenylistTest.java23 import com.android.server.appsearch.external.localstorage.stats.CallStats;
33 for (Integer apiType : CallStats.getAllApiCallTypes()) { in testEmptyDenylistDeniesNothing()
52 for (Integer apiType : CallStats.getAllApiCallTypes()) { in testDenyAllApis()
64 for (Integer apiType : CallStats.getAllApiCallTypes()) { in testDenyNoApis()
74 Arrays.asList(CallStats.CALL_TYPE_SET_SCHEMA, CallStats.CALL_TYPE_GET_SCHEMA, in testDenySomeApis()
75 CallStats.CALL_TYPE_GET_NAMESPACES)); in testDenySomeApis()
76 Set<Integer> apiTypes = CallStats.getAllApiCallTypes(); in testDenySomeApis()
90 CallStats.CALL_TYPE_SET_SCHEMA)).isTrue(); in testDenyByPackage()
92 CallStats.CALL_TYPE_SET_SCHEMA)).isTrue(); in testDenyByPackage()
93 assertThat(denylist.checkDeniedPackage("foo", CallStats.CALL_TYPE_SET_SCHEMA)).isTrue(); in testDenyByPackage()
[all …]
DRateLimitedExecutorTest.java23 import com.android.server.appsearch.external.localstorage.stats.CallStats;
50 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_PUT_DOCUMENTS)).isEqualTo(5); in testAddTaskToQueue_addOk()
51 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_GET_DOCUMENTS)).isEqualTo(40); in testAddTaskToQueue_addOk()
52 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_SET_SCHEMA)).isEqualTo(99); in testAddTaskToQueue_addOk()
55 CallStats.CALL_TYPE_PUT_DOCUMENTS)).isTrue(); in testAddTaskToQueue_addOk()
57 CallStats.CALL_TYPE_GET_DOCUMENTS)).isTrue(); in testAddTaskToQueue_addOk()
59 CallStats.CALL_TYPE_GET_DOCUMENTS)).isTrue(); in testAddTaskToQueue_addOk()
61 CallStats.CALL_TYPE_PUT_DOCUMENTS)).isTrue(); in testAddTaskToQueue_addOk()
79 CallStats.CALL_TYPE_SET_SCHEMA)).isFalse(); in testAddTaskToQueue_exceedsPerPackageCapacity_cannotAddTask()
85 CallStats.CALL_TYPE_PUT_DOCUMENTS)).isTrue(); in testAddTaskToQueue_exceedsPerPackageCapacity_cannotAddTask()
[all …]
/packages/modules/AppSearch/service/java/com/android/server/appsearch/util/
DApiCallRecord.java24 import com.android.server.appsearch.external.localstorage.stats.CallStats;
34 @CallStats.CallType private final int mCallType;
44 public ApiCallRecord(@NonNull CallStats callStats) { in ApiCallRecord()
59 mCallType = CallStats.CALL_TYPE_OPTIMIZE; in ApiCallRecord()
70 @CallStats.CallType
103 case CallStats.CALL_TYPE_INITIALIZE: in getCallTypeName()
105 case CallStats.CALL_TYPE_SET_SCHEMA: in getCallTypeName()
107 case CallStats.CALL_TYPE_PUT_DOCUMENTS: in getCallTypeName()
109 case CallStats.CALL_TYPE_GET_DOCUMENTS: in getCallTypeName()
111 case CallStats.CALL_TYPE_REMOVE_DOCUMENTS_BY_ID: in getCallTypeName()
[all …]
DRateLimitedExecutor.java26 import com.android.server.appsearch.external.localstorage.stats.CallStats;
84 @CallStats.CallType int apiType) { in execute()
133 public boolean addTaskToQueue(@NonNull String packageName, @CallStats.CallType int apiType) { in addTaskToQueue()
159 public void removeTaskFromQueue(@NonNull String packageName, @CallStats.CallType int apiType) { in removeTaskFromQueue()
DServiceImplHelper.java45 import com.android.server.appsearch.external.localstorage.stats.CallStats;
365 @CallStats.CallType int apiType, in executeLambdaForUserAsync()
416 @CallStats.CallType int apiType, in executeLambdaForUserAsync()
461 @CallStats.CallType int apiType, in executeLambdaForUserNoCallbackAsync()
/packages/modules/AppSearch/testing/mockingservicestests/src/com/android/server/appsearch/stats/
DMockingPlatformLoggerTest.java31 import com.android.server.appsearch.external.localstorage.stats.CallStats;
83 CallStats.CALL_TYPE_UNKNOWN).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalNotSet_returnsDefault()
86 CallStats.CALL_TYPE_INITIALIZE).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalNotSet_returnsDefault()
89 CallStats.CALL_TYPE_SEARCH).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalNotSet_returnsDefault()
92 CallStats.CALL_TYPE_FLUSH).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalNotSet_returnsDefault()
128 CallStats.CALL_TYPE_INITIALIZE).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalSet_returnsConfigured()
131 CallStats.CALL_TYPE_FLUSH).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalSet_returnsConfigured()
137 CallStats.CALL_TYPE_PUT_DOCUMENT).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalSet_returnsConfigured()
140 CallStats.CALL_TYPE_PUT_DOCUMENTS).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalSet_returnsConfigured()
143 CallStats.CALL_TYPE_REMOVE_DOCUMENTS_BY_SEARCH).mSamplingInterval).isEqualTo( in testCreateExtraStatsLocked_samplingIntervalSet_returnsConfigured()
[all …]
/packages/modules/AppSearch/service/java/com/android/server/appsearch/stats/
DPlatformLogger.java36 import com.android.server.appsearch.external.localstorage.stats.CallStats;
137 public void logStats(@NonNull CallStats stats) { in logStats()
156 if (shouldLogForTypeLocked(CallStats.CALL_TYPE_PUT_DOCUMENT)) { in logStats()
166 if (shouldLogForTypeLocked(CallStats.CALL_TYPE_INITIALIZE)) { in logStats()
176 if (shouldLogForTypeLocked(CallStats.CALL_TYPE_SEARCH)) { in logStats()
198 if (shouldLogForTypeLocked(CallStats.CALL_TYPE_OPTIMIZE)) { in logStats()
208 if (shouldLogForTypeLocked(CallStats.CALL_TYPE_SET_SCHEMA)) { in logStats()
218 if (shouldLogForTypeLocked(CallStats.CALL_TYPE_SCHEMA_MIGRATION)) { in logStats()
270 private void logStatsImplLocked(@NonNull CallStats stats) { in logStatsImplLocked()
317 createExtraStatsLocked(stats.getPackageName(), CallStats.CALL_TYPE_SET_SCHEMA); in logStatsImplLocked()
[all …]
/packages/modules/AppSearch/service/java/com/android/server/appsearch/
DAppSearchManagerService.java116 import com.android.server.appsearch.external.localstorage.stats.CallStats;
445 CallStats.CALL_TYPE_SET_SCHEMA, callback, targetUser, in setSchema()
454 targetUser, callback, callingPackageName, CallStats.CALL_TYPE_SET_SCHEMA, in setSchema()
521 instance.getLogger().logStats(new CallStats.Builder() in setSchema()
526 .setCallType(CallStats.CALL_TYPE_SET_SCHEMA) in setSchema()
544 CallStats.CALL_TYPE_SET_SCHEMA, targetUser, in setSchema()
579 int callType = global ? CallStats.CALL_TYPE_GLOBAL_GET_SCHEMA in getSchema()
580 : CallStats.CALL_TYPE_GET_SCHEMA; in getSchema()
620 instance.getLogger().logStats(new CallStats.Builder() in getSchema()
658 CallStats.CALL_TYPE_GET_NAMESPACES, callback, targetUser, in getNamespaces()
[all …]
DDenylist.java26 import com.android.server.appsearch.external.localstorage.stats.CallStats;
182 @CallStats.CallType int apiType = CallStats.getApiCallTypeFromName(apis[i]); in retrieveApiTypes()
183 if (apiType != CallStats.CALL_TYPE_UNKNOWN) { in retrieveApiTypes()
222 @CallStats.CallType int apiType) { in checkDeniedPackageDatabase()
244 @NonNull String packageName, @CallStats.CallType int apiType) { in checkDeniedPackage()
258 @NonNull String databaseName, @CallStats.CallType int apiType) { in checkDeniedDatabase()
DAppSearchRateLimitConfig.java25 import com.android.server.appsearch.external.localstorage.stats.CallStats;
138 public int getApiCost(@CallStats.CallType int apiType) { in getApiCost()
170 @CallStats.CallType int apiType = CallStats.getApiCallTypeFromName(apiName); in createApiCostsMap()
171 if (apiType == CallStats.CALL_TYPE_UNKNOWN) { in createApiCostsMap()
/packages/modules/AppSearch/testing/mockingservicestests/src/com/android/server/appsearch/
DAppSearchManagerServiceTest.java133 import com.android.server.appsearch.external.localstorage.stats.CallStats;
326 verifyCallStats(mContext.getPackageName(), DATABASE_NAME, CallStats.CALL_TYPE_SET_SCHEMA); in testSetSchemaStatsLogging()
350 verifyCallStats(mContext.getPackageName(), DATABASE_NAME, CallStats.CALL_TYPE_GET_SCHEMA); in testLocalGetSchemaStatsLogging()
366 CallStats.CALL_TYPE_GLOBAL_GET_SCHEMA); in testGlobalGetSchemaStatsLogging()
380 CallStats.CALL_TYPE_GET_NAMESPACES); in testGetNamespacesStatsLogging()
394 CallStats.CALL_TYPE_PUT_DOCUMENTS); in testPutDocumentsStatsLogging()
511 mContext.getPackageName(), DATABASE_NAME, CallStats.CALL_TYPE_PUT_DOCUMENTS); in testPutDocumentsStatsLogging_takenActions()
565 CallStats.CALL_TYPE_GET_DOCUMENTS); in testLocalGetDocumentsStatsLogging()
584 CallStats.CALL_TYPE_GLOBAL_GET_DOCUMENT_BY_ID); in testGlobalGetDocumentsStatsLogging()
596 verifyCallStats(mContext.getPackageName(), DATABASE_NAME, CallStats.CALL_TYPE_SEARCH); in testSearchStatsLogging()
[all …]
DServiceAppSearchConfigTest.java81 import com.android.server.appsearch.external.localstorage.stats.CallStats;
155 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_GET_DOCUMENT)).isEqualTo( in testDefaultValues_allCachedValue()
157 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_GET_NEXT_PAGE)).isEqualTo( in testDefaultValues_allCachedValue()
159 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_SET_SCHEMA)).isEqualTo( in testDefaultValues_allCachedValue()
161 assertThat(rateLimitConfig.getApiCost(CallStats.CALL_TYPE_SEARCH)).isEqualTo( in testDefaultValues_allCachedValue()
628 CallStats.CALL_TYPE_SET_SCHEMA)).isTrue(); in testCustomizedValue_denylist()
630 CallStats.CALL_TYPE_GET_SCHEMA)).isTrue(); in testCustomizedValue_denylist()
632 CallStats.CALL_TYPE_INITIALIZE)).isFalse(); in testCustomizedValue_denylist()
641 for (Integer apiType : CallStats.getAllApiCallTypes()) { in testCustomizedValueOverride_denylist()
653 CallStats.CALL_TYPE_INITIALIZE)).isTrue(); in testCustomizedValueOverride_denylist()
[all …]
/packages/modules/AppSearch/testing/servicestests/src/com/android/server/appsearch/external/localstorage/stats/
DAppSearchStatsTest.java37 final @CallStats.CallType int callType = CallStats.CALL_TYPE_PUT_DOCUMENTS; in testAppSearchStats_CallStats()
39 final CallStats cStats = in testAppSearchStats_CallStats()
40 new CallStats.Builder() in testAppSearchStats_CallStats()
64 final @CallStats.CallType int callType = CallStats.CALL_TYPE_PUT_DOCUMENTS; in testAppSearchCallStats_nullValues()
66 final CallStats.Builder cStatsBuilder = new CallStats.Builder().setCallType(callType); in testAppSearchCallStats_nullValues()
68 final CallStats cStats = cStatsBuilder.build(); in testAppSearchCallStats_nullValues()
/packages/modules/AppSearch/testing/servicestests/src/com/android/server/appsearch/stats/
DPlatformLoggerTest.java37 import com.android.server.appsearch.external.localstorage.stats.CallStats;
153 CallStats.CALL_TYPE_PUT_DOCUMENT); in testGetPackageUidAsUser()
160 CallStats.CALL_TYPE_PUT_DOCUMENT); in testGetPackageUidAsUser()
170 CallStats.CALL_TYPE_PUT_DOCUMENT); in testGetPackageUidAsUser()
/packages/modules/AppSearch/service/java/com/android/server/appsearch/external/localstorage/stats/
DCallStats.java46 public class CallStats { class
167 CallStats(@NonNull Builder builder) { in CallStats() method in CallStats
340 public CallStats build() { in build()
341 return new CallStats(/* builder= */ this); in build()
/packages/modules/AppSearch/service/java/com/android/server/appsearch/external/localstorage/
DAppSearchLogger.java22 import com.android.server.appsearch.external.localstorage.stats.CallStats;
45 void logStats(@NonNull CallStats stats); in logStats()
/packages/modules/AppSearch/testing/servicestests/src/android/app/appsearch/testutil/external/testutil/
DSimpleTestLoggerTest.java23 import com.android.server.appsearch.external.localstorage.stats.CallStats;
52 logger.logStats(new CallStats.Builder().build()); in testLogger_fieldsAreSetAfterLogging()