Class ConfluenceInstrumentRegistry
- java.lang.Object
-
- com.atlassian.confluence.util.profiling.ConfluenceInstrumentRegistry
-
- All Implemented Interfaces:
ControllableInstrumentRegistry,com.atlassian.instrumentation.InstrumentRegistry,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class ConfluenceInstrumentRegistry extends Object implements ControllableInstrumentRegistry, org.springframework.context.ApplicationContextAware
Central InstrumentRegistry for Confluence. This will be export as OSGI service for JMX exposer. The main reason we have this class is we want to get the configuration at runtime from Spring so Spring could decide the isolation level of the configuration (in this case ThreadLocal)- Since:
- 6.1.0
-
-
Constructor Summary
Constructors Constructor Description ConfluenceInstrumentRegistry(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory)ConfluenceInstrumentRegistry(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory, Supplier<com.atlassian.instrumentation.RegistryConfiguration> registryConfigurationSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the currently held statistics.voiddisableMonitoring()Disable monitoring.voidenableMonitoring()Enables monitoring.com.atlassian.instrumentation.InstrumentgetInstrument(String name)intgetNumberOfInstruments()we still allow to create instrument when disable but won't report any instrument out sidecom.atlassian.instrumentation.RegistryConfigurationgetRegistryConfiguration()booleanisMonitoringEnabled()Check instrument registry is enable or notcom.atlassian.instrumentation.AbsoluteCounterpullAbsoluteCounter(String name)com.atlassian.instrumentation.caches.CacheCollectorpullCacheCollector(String name)com.atlassian.instrumentation.caches.CacheCollectorpullCacheCollector(String name, com.atlassian.instrumentation.caches.CacheCollector.Sizer sizer)com.atlassian.instrumentation.caches.CacheCounterpullCacheCounter(String name)com.atlassian.instrumentation.caches.CacheCounterpullCacheCounter(String name, com.atlassian.instrumentation.caches.CacheCounter.Sizer sizer)com.atlassian.instrumentation.CounterpullCounter(String name)com.atlassian.instrumentation.DerivedCounterpullDerivedCounter(String name)com.atlassian.instrumentation.GaugepullGauge(String name)com.atlassian.instrumentation.operations.OpCounterpullOpCounter(String name)com.atlassian.instrumentation.operations.OpTimerpullTimer(String name)protected com.atlassian.instrumentation.InstrumentputIfAbsent(String name, com.atlassian.instrumentation.Instrument possiblyNeeded)com.atlassian.instrumentation.InstrumentputInstrument(com.atlassian.instrumentation.Instrument instrument)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)List<com.atlassian.instrumentation.Instrument>snapshotInstruments()we still allow to create instrument when disable but won't report any instrument out side
-
-
-
Constructor Detail
-
ConfluenceInstrumentRegistry
public ConfluenceInstrumentRegistry(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory)
-
ConfluenceInstrumentRegistry
public ConfluenceInstrumentRegistry(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory, Supplier<com.atlassian.instrumentation.RegistryConfiguration> registryConfigurationSupplier)
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getRegistryConfiguration
public com.atlassian.instrumentation.RegistryConfiguration getRegistryConfiguration()
- Specified by:
getRegistryConfigurationin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
putInstrument
public com.atlassian.instrumentation.Instrument putInstrument(com.atlassian.instrumentation.Instrument instrument)
- Specified by:
putInstrumentin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
getInstrument
public com.atlassian.instrumentation.Instrument getInstrument(String name)
- Specified by:
getInstrumentin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
putIfAbsent
protected com.atlassian.instrumentation.Instrument putIfAbsent(String name, com.atlassian.instrumentation.Instrument possiblyNeeded)
-
pullAbsoluteCounter
public com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(String name)
- Specified by:
pullAbsoluteCounterin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCounter
public com.atlassian.instrumentation.Counter pullCounter(String name)
- Specified by:
pullCounterin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullDerivedCounter
public com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(String name)
- Specified by:
pullDerivedCounterin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullGauge
public com.atlassian.instrumentation.Gauge pullGauge(String name)
- Specified by:
pullGaugein interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCollector
public com.atlassian.instrumentation.caches.CacheCollector pullCacheCollector(String name, com.atlassian.instrumentation.caches.CacheCollector.Sizer sizer)
- Specified by:
pullCacheCollectorin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCollector
public com.atlassian.instrumentation.caches.CacheCollector pullCacheCollector(String name)
- Specified by:
pullCacheCollectorin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCounter
public com.atlassian.instrumentation.caches.CacheCounter pullCacheCounter(String name, com.atlassian.instrumentation.caches.CacheCounter.Sizer sizer)
- Specified by:
pullCacheCounterin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCounter
public com.atlassian.instrumentation.caches.CacheCounter pullCacheCounter(String name)
- Specified by:
pullCacheCounterin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullOpCounter
public com.atlassian.instrumentation.operations.OpCounter pullOpCounter(String name)
- Specified by:
pullOpCounterin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullTimer
public com.atlassian.instrumentation.operations.OpTimer pullTimer(String name)
- Specified by:
pullTimerin interfacecom.atlassian.instrumentation.InstrumentRegistry
-
snapshotInstruments
public List<com.atlassian.instrumentation.Instrument> snapshotInstruments()
we still allow to create instrument when disable but won't report any instrument out side- Specified by:
snapshotInstrumentsin interfacecom.atlassian.instrumentation.InstrumentRegistry- Returns:
- empty list if disable
-
getNumberOfInstruments
public int getNumberOfInstruments()
we still allow to create instrument when disable but won't report any instrument out side- Specified by:
getNumberOfInstrumentsin interfacecom.atlassian.instrumentation.InstrumentRegistry- Returns:
- zero if disable
-
isMonitoringEnabled
public boolean isMonitoringEnabled()
Description copied from interface:ControllableInstrumentRegistryCheck instrument registry is enable or not- Specified by:
isMonitoringEnabledin interfaceControllableInstrumentRegistry- Returns:
-
enableMonitoring
public void enableMonitoring()
Description copied from interface:ControllableInstrumentRegistryEnables monitoring. It does not effect whether CPU timing is enabled.- Specified by:
enableMonitoringin interfaceControllableInstrumentRegistry
-
disableMonitoring
public void disableMonitoring()
Description copied from interface:ControllableInstrumentRegistryDisable monitoring. It does not effect whether CPU timing is enabled.- Specified by:
disableMonitoringin interfaceControllableInstrumentRegistry
-
clear
public void clear()
Description copied from interface:ControllableInstrumentRegistryClears the currently held statistics.- Specified by:
clearin interfaceControllableInstrumentRegistry
-
-