Skip to content

Commit

Permalink
Revert "Add temporary logging for cache stats"
Browse files Browse the repository at this point in the history
This reverts commit c801bcb.
  • Loading branch information
igdianov committed Dec 23, 2024
1 parent cafb7b6 commit a2c8558
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,15 @@
*/
package org.activiti.cloud.runtime;

import com.github.benmanes.caffeine.cache.stats.CacheStats;
import org.activiti.cloud.starter.rb.configuration.ActivitiRuntimeBundle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.CacheManager;
import org.springframework.cache.caffeine.CaffeineCache;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@SpringBootApplication
@ActivitiRuntimeBundle
@EnableScheduling
public class RuntimeBundleApplication {

@Autowired
private CacheManager cacheManager;

public static void main(String[] args) {
SpringApplication.run(RuntimeBundleApplication.class, args);
}

@Scheduled(fixedRate = 10000)
void printCacheStats() {
cacheManager
.getCacheNames()
.forEach(name -> {
CaffeineCache cache = (CaffeineCache) cacheManager.getCache(name);
CacheStats stats = cache.getNativeCache().stats();

System.out.println("Cache: " + name);
System.out.println(" Recording Stats: " + cache.getNativeCache().policy().isRecordingStats());
System.out.println(" Estimated Size: " + cache.getNativeCache().estimatedSize());
System.out.println(" Stats: " + stats);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
@EnableConfigurationProperties(value = AuthorizationProperties.class)
public class SecurityTestConfiguration {


@Bean
public ClientRegistrationRepository clientRegistrationRepository() {
return mock(ClientRegistrationRepository.class);
Expand Down

0 comments on commit a2c8558

Please sign in to comment.