Class MetricsConfig

java.lang.Object
ubic.gemma.core.config.MetricsConfig

@Configuration @Profile("metrics") public class MetricsConfig extends Object
Phase 3 XML->Java migration: replaces the <beans profile="metrics"> block from applicationContext-serviceBeans.xml. Activated only when the metrics Spring profile is set; otherwise none of these beans are instantiated.

The legacy MeterRegistryEhcacheConfigurer (Ehcache 2.x API) was deleted in Phase 2 along with the rest of the Ehcache 2 stack, which left the metrics profile broken until Phase 3. It is replaced here by meterRegistryJCacheConfigurer(MeterRegistry, CacheManager) which binds per-cache JSR-107 metrics from the new Ehcache 3 / JCache backend.

  • Constructor Details

    • MetricsConfig

      public MetricsConfig()
  • Method Details

    • meterRegistry

      @Bean public io.micrometer.core.instrument.MeterRegistry meterRegistry()
    • genericMeterRegistryConfigurer

      @Bean public GenericMeterRegistryConfigurer genericMeterRegistryConfigurer(io.micrometer.core.instrument.MeterRegistry meterRegistry, SessionFactory sessionFactory, DataSource dataSource, org.springframework.core.task.TaskExecutor taskExecutor, TaskRunningService taskRunningService, List<VirtualThreadExecutorMetrics> vtExecutorMetrics)
      Aggregate all the MeterBinders the legacy XML registered (basic JVM metrics, logging metrics, two Hibernate session-factory binders, one Hikari pool binder, one task-executor binder) plus the TaskRunningService bean (which itself implements MeterBinder). Order preserved from the XML.
    • timedAspect

      @Bean public io.micrometer.core.aop.TimedAspect timedAspect(io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Enables @Timed-annotated method timing. The XML had a sibling <aop:aspectj-autoproxy/>; the consolidated @EnableAspectJAutoProxy on ComponentScanConfig now covers it.
    • meterRegistryJCacheConfigurer

      @Bean public MeterRegistryJCacheConfigurer meterRegistryJCacheConfigurer(io.micrometer.core.instrument.MeterRegistry meterRegistry, javax.cache.CacheManager jCacheCacheManager)
      Per-cache JSR-107 metrics (Ehcache 3 / JCache backend, see EhcacheConfig). Replaces the MeterRegistryJCacheConfigurer XML bean previously declared in applicationContext-serviceBeans.xml.