Searched refs:rateLimitConfig (Results 1 – 5 of 5) sorted by relevance
/packages/modules/AppSearch/testing/servicestests/src/com/android/server/appsearch/ |
D | AppSearchRateLimitConfigTest.java | 32 AppSearchRateLimitConfig rateLimitConfig = AppSearchRateLimitConfig.create( in testDefaultRateLimitConfig() local 37 assertThat(rateLimitConfig.getTaskQueueTotalCapacity()).isEqualTo( in testDefaultRateLimitConfig() 39 assertThat(rateLimitConfig.getTaskQueuePerPackageCapacity()).isEqualTo( in testDefaultRateLimitConfig() 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() 46 assertThat(rateLimitConfig.getApiCost( in testDefaultRateLimitConfig() 52 AppSearchRateLimitConfig rateLimitConfig = in testCustomRateLimitConfig() local 56 assertThat(rateLimitConfig.getTaskQueueTotalCapacity()).isEqualTo(1000); in testCustomRateLimitConfig() 57 assertThat(rateLimitConfig.getTaskQueuePerPackageCapacity()).isEqualTo(800); in testCustomRateLimitConfig() [all …]
|
D | RateLimitedExecutorTest.java | 44 AppSearchRateLimitConfig rateLimitConfig = AppSearchRateLimitConfig.create(100, 0.9f, in testAddTaskToQueue_addOk() local 47 rateLimitConfig); in testAddTaskToQueue_addOk() 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() 71 AppSearchRateLimitConfig rateLimitConfig = AppSearchRateLimitConfig.create(100, 0.9f, in testAddTaskToQueue_exceedsPerPackageCapacity_cannotAddTask() local 74 rateLimitConfig); in testAddTaskToQueue_exceedsPerPackageCapacity_cannotAddTask() 110 AppSearchRateLimitConfig rateLimitConfig = AppSearchRateLimitConfig.create(100, 0.9f, in testAddTaskToQueue_otherPackageExceedsPerPackageCapacity_canAddTask() local 113 rateLimitConfig); in testAddTaskToQueue_otherPackageExceedsPerPackageCapacity_canAddTask() 147 AppSearchRateLimitConfig rateLimitConfig = AppSearchRateLimitConfig.create(100, 0.9f, in testAddTaskToQueue_exceedsTotalCapacity_cannotAddTask() local [all …]
|
/packages/modules/AppSearch/testing/mockingservicestests/src/com/android/server/appsearch/ |
D | ServiceAppSearchConfigTest.java | 148 AppSearchRateLimitConfig rateLimitConfig = appSearchConfig.getCachedRateLimitConfig(); in testDefaultValues_allCachedValue() local 149 assertThat(rateLimitConfig.getTaskQueueTotalCapacity()).isEqualTo( in testDefaultValues_allCachedValue() 151 assertThat(rateLimitConfig.getTaskQueuePerPackageCapacity()).isEqualTo( in testDefaultValues_allCachedValue() 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() 785 AppSearchRateLimitConfig rateLimitConfig = appSearchConfig.getCachedRateLimitConfig(); in testCustomizedValueOverride_rateLimitConfig() local 786 assertThat(rateLimitConfig.getTaskQueueTotalCapacity()).isEqualTo( in testCustomizedValueOverride_rateLimitConfig() 788 assertThat(rateLimitConfig.getTaskQueuePerPackageCapacity()).isEqualTo( in testCustomizedValueOverride_rateLimitConfig() [all …]
|
/packages/modules/AppSearch/service/java/com/android/server/appsearch/util/ |
D | ExecutorManager.java | 119 @NonNull UserHandle userHandle, @NonNull AppSearchRateLimitConfig rateLimitConfig) { in getOrCreateUserRateLimitedExecutorLocked() argument 121 Objects.requireNonNull(rateLimitConfig); in getOrCreateUserRateLimitedExecutorLocked() 124 ((RateLimitedExecutor) executor).setRateLimitConfig(rateLimitConfig); in getOrCreateUserRateLimitedExecutorLocked() 128 ExecutorManager.createDefaultExecutorService(), rateLimitConfig); in getOrCreateUserRateLimitedExecutorLocked()
|
D | RateLimitedExecutor.java | 66 @NonNull ExecutorService executor, @NonNull AppSearchRateLimitConfig rateLimitConfig) { in RateLimitedExecutor() argument 68 mRateLimitConfigLocked = Objects.requireNonNull(rateLimitConfig); in RateLimitedExecutor()
|