Search in sources :

Example 6 with CacheStatisticsProvider

use of org.springframework.boot.actuate.cache.CacheStatisticsProvider in project spring-boot by spring-projects.

the class CacheStatisticsAutoConfigurationTests method baseCaffeineCacheStatistics.

@Test
public void baseCaffeineCacheStatistics() {
    load(CaffeineCacheConfig.class);
    CacheStatisticsProvider provider = this.context.getBean("caffeineCacheStatisticsProvider", CacheStatisticsProvider.class);
    doTestCoreStatistics(provider, true);
}
Also used : CacheStatisticsProvider(org.springframework.boot.actuate.cache.CacheStatisticsProvider) Test(org.junit.Test)

Example 7 with CacheStatisticsProvider

use of org.springframework.boot.actuate.cache.CacheStatisticsProvider in project spring-boot by spring-projects.

the class CacheStatisticsAutoConfigurationTests method concurrentMapCacheStatistics.

@Test
public void concurrentMapCacheStatistics() {
    load(ConcurrentMapConfig.class);
    CacheStatisticsProvider provider = this.context.getBean("concurrentMapCacheStatisticsProvider", CacheStatisticsProvider.class);
    Cache books = getCache("books");
    CacheStatistics cacheStatistics = provider.getCacheStatistics(this.cacheManager, books);
    assertCoreStatistics(cacheStatistics, 0L, null, null);
    getOrCreate(books, "a", "b", "b", "a", "a");
    CacheStatistics updatedCacheStatistics = provider.getCacheStatistics(this.cacheManager, books);
    assertCoreStatistics(updatedCacheStatistics, 2L, null, null);
}
Also used : CacheStatistics(org.springframework.boot.actuate.cache.CacheStatistics) CacheStatisticsProvider(org.springframework.boot.actuate.cache.CacheStatisticsProvider) Cache(org.springframework.cache.Cache) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 CacheStatisticsProvider (org.springframework.boot.actuate.cache.CacheStatisticsProvider)7 CacheStatistics (org.springframework.boot.actuate.cache.CacheStatistics)2 Cache (org.springframework.cache.Cache)2