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
ConstructorsConstructorDescriptionConfluenceInstrumentRegistry
(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory) ConfluenceInstrumentRegistry
(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory, Supplier<com.atlassian.instrumentation.RegistryConfiguration> registryConfigurationSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the currently held statistics.void
Disable monitoring.void
Enables monitoring.com.atlassian.instrumentation.Instrument
getInstrument
(String name) int
we still allow to create instrument when disable but won't report any instrument out sidecom.atlassian.instrumentation.RegistryConfiguration
boolean
Check instrument registry is enable or notcom.atlassian.instrumentation.AbsoluteCounter
pullAbsoluteCounter
(String name) com.atlassian.instrumentation.caches.CacheCollector
pullCacheCollector
(String name) com.atlassian.instrumentation.caches.CacheCollector
pullCacheCollector
(String name, com.atlassian.instrumentation.caches.CacheCollector.Sizer sizer) com.atlassian.instrumentation.caches.CacheCounter
pullCacheCounter
(String name) com.atlassian.instrumentation.caches.CacheCounter
pullCacheCounter
(String name, com.atlassian.instrumentation.caches.CacheCounter.Sizer sizer) com.atlassian.instrumentation.Counter
pullCounter
(String name) com.atlassian.instrumentation.DerivedCounter
pullDerivedCounter
(String name) com.atlassian.instrumentation.Gauge
com.atlassian.instrumentation.operations.OpCounter
pullOpCounter
(String name) com.atlassian.instrumentation.operations.OpTimer
protected com.atlassian.instrumentation.Instrument
putIfAbsent
(String name, com.atlassian.instrumentation.Instrument possiblyNeeded) com.atlassian.instrumentation.Instrument
putInstrument
(com.atlassian.instrumentation.Instrument instrument) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) List<com.atlassian.instrumentation.Instrument>
we still allow to create instrument when disable but won't report any instrument out side
-
Constructor Details
-
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 Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
getRegistryConfiguration
public com.atlassian.instrumentation.RegistryConfiguration getRegistryConfiguration()- Specified by:
getRegistryConfiguration
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
putInstrument
public com.atlassian.instrumentation.Instrument putInstrument(com.atlassian.instrumentation.Instrument instrument) - Specified by:
putInstrument
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
getInstrument
- Specified by:
getInstrument
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
putIfAbsent
protected com.atlassian.instrumentation.Instrument putIfAbsent(String name, com.atlassian.instrumentation.Instrument possiblyNeeded) -
pullAbsoluteCounter
- Specified by:
pullAbsoluteCounter
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCounter
- Specified by:
pullCounter
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullDerivedCounter
- Specified by:
pullDerivedCounter
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullGauge
- Specified by:
pullGauge
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCollector
public com.atlassian.instrumentation.caches.CacheCollector pullCacheCollector(String name, com.atlassian.instrumentation.caches.CacheCollector.Sizer sizer) - Specified by:
pullCacheCollector
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCollector
- Specified by:
pullCacheCollector
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCounter
public com.atlassian.instrumentation.caches.CacheCounter pullCacheCounter(String name, com.atlassian.instrumentation.caches.CacheCounter.Sizer sizer) - Specified by:
pullCacheCounter
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullCacheCounter
- Specified by:
pullCacheCounter
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullOpCounter
- Specified by:
pullOpCounter
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
pullTimer
- Specified by:
pullTimer
in interfacecom.atlassian.instrumentation.InstrumentRegistry
-
snapshotInstruments
we still allow to create instrument when disable but won't report any instrument out side- Specified by:
snapshotInstruments
in 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:
getNumberOfInstruments
in interfacecom.atlassian.instrumentation.InstrumentRegistry
- Returns:
- zero if disable
-
isMonitoringEnabled
public boolean isMonitoringEnabled()Description copied from interface:ControllableInstrumentRegistry
Check instrument registry is enable or not- Specified by:
isMonitoringEnabled
in interfaceControllableInstrumentRegistry
- Returns:
-
enableMonitoring
public void enableMonitoring()Description copied from interface:ControllableInstrumentRegistry
Enables monitoring. It does not effect whether CPU timing is enabled.- Specified by:
enableMonitoring
in interfaceControllableInstrumentRegistry
-
disableMonitoring
public void disableMonitoring()Description copied from interface:ControllableInstrumentRegistry
Disable monitoring. It does not effect whether CPU timing is enabled.- Specified by:
disableMonitoring
in interfaceControllableInstrumentRegistry
-
clear
public void clear()Description copied from interface:ControllableInstrumentRegistry
Clears the currently held statistics.- Specified by:
clear
in interfaceControllableInstrumentRegistry
-