Class AtlassianInstrumentationConfluenceMonitoring
- java.lang.Object
-
- com.atlassian.confluence.util.profiling.AtlassianInstrumentationConfluenceMonitoring
-
- All Implemented Interfaces:
ConfluenceMonitoring,ConfluenceMonitoringControl
@Internal @ParametersAreNonnullByDefault public class AtlassianInstrumentationConfluenceMonitoring extends Object implements ConfluenceMonitoring, ConfluenceMonitoringControl
An implementation of the Confluence Monitoring interfaces that's based upon the Atlassian Instrumentation library.- Since:
- 5.7
-
-
Constructor Summary
Constructors Constructor Description AtlassianInstrumentationConfluenceMonitoring(ControllableInstrumentRegistry instrumentRegistry, MutableRegistryConfiguration registryConfiguration, io.micrometer.core.instrument.MeterRegistry micrometerRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the currently held statistics.voiddisableAllMonitoring()voiddisableCpuTiming()Disable capturing CPU timing.voiddisableHibernateMonitoring()Disable Hibernate monitoring.voiddisableMonitoring()Disable monitoring.voidenableCpuTiming()Enable capturing CPU timing.voidenableHibernateMonitoring()Enables Hibernate monitoring.voidenableMonitoring()Enables monitoring.@NonNull CounterfetchCounter(String name, String... optional)Fetches the counter associated with the supplied name details.@NonNull CounterfetchCounter(String name, Map<String,String> tags)Fetches the counter associated with the supplied name details.booleanisCpuTimingEnabled()booleanisMonitoringEnabled()@NonNull List<CounterSnapshot>snapshotCounters()Returns a snapshot of the counters.@NonNull List<TimerSnapshot>snapshotTimers()Returns a snapshot of the timers.@NonNull SplitstartSplit(String name, String... optional)Creates and starts a split timer associated with the supplied name details.@NonNull SplitstartSplit(String name, Map<String,String> tags)Creates and starts a split timer associated with the supplied name details.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.util.profiling.ConfluenceMonitoring
createName, fetchCounter, startSplit
-
-
-
-
Constructor Detail
-
AtlassianInstrumentationConfluenceMonitoring
public AtlassianInstrumentationConfluenceMonitoring(ControllableInstrumentRegistry instrumentRegistry, MutableRegistryConfiguration registryConfiguration, io.micrometer.core.instrument.MeterRegistry micrometerRegistry)
-
-
Method Detail
-
fetchCounter
public @NonNull Counter fetchCounter(String name, String... optional)
Description copied from interface:ConfluenceMonitoringFetches the counter associated with the supplied name details. The name is constructed callingConfluenceMonitoring.createName(String, String...).- Specified by:
fetchCounterin interfaceConfluenceMonitoring- Parameters:
name- the mandatory suggested nameoptional- the optional parts to concatenate with themandatorysuggestion- Returns:
- the counter associated with the name.
-
fetchCounter
public @NonNull Counter fetchCounter(String name, Map<String,String> tags)
Description copied from interface:ConfluenceMonitoringFetches the counter associated with the supplied name details.- Specified by:
fetchCounterin interfaceConfluenceMonitoring- Parameters:
name- the mandatory suggested nametags- the name-value tags to apply- Returns:
- the counter associated with the name.
- Since:
- 7.1
-
startSplit
public @NonNull Split startSplit(String name, String... optional)
Description copied from interface:ConfluenceMonitoringCreates and starts a split timer associated with the supplied name details. The name is constructed callingConfluenceMonitoring.createName(String, String...).The typical usage is:
try (Split split = instance.startSplit("name")) { // code to execute }- Specified by:
startSplitin interfaceConfluenceMonitoring- Parameters:
name- the mandatory suggested nameoptional- the optional parts to concatenate with themandatorysuggestion- Returns:
- the running split timer
-
startSplit
public @NonNull Split startSplit(String name, Map<String,String> tags)
Description copied from interface:ConfluenceMonitoringCreates and starts a split timer associated with the supplied name details.The typical usage is:
try (Split split = instance.startSplit("name", singletonMap("tagname", "tagvalue"))) { // code to execute }- Specified by:
startSplitin interfaceConfluenceMonitoring- Parameters:
name- the mandatory suggested nametags- the name-value tags to apply- Returns:
- the running split timer
- Since:
- 7.1
-
isMonitoringEnabled
public boolean isMonitoringEnabled()
- Specified by:
isMonitoringEnabledin interfaceConfluenceMonitoringControl- Returns:
- whether monitoring is enabled.
-
enableMonitoring
public void enableMonitoring()
Description copied from interface:ConfluenceMonitoringControlEnables monitoring. It does not effect whether CPU timing is enabled.- Specified by:
enableMonitoringin interfaceConfluenceMonitoringControl
-
disableMonitoring
public void disableMonitoring()
Description copied from interface:ConfluenceMonitoringControlDisable monitoring. It does not effect whether CPU timing is enabled.- Specified by:
disableMonitoringin interfaceConfluenceMonitoringControl
-
isCpuTimingEnabled
public boolean isCpuTimingEnabled()
- Specified by:
isCpuTimingEnabledin interfaceConfluenceMonitoringControl- Returns:
- whether CPU timing is enabled.
-
enableCpuTiming
public void enableCpuTiming()
Description copied from interface:ConfluenceMonitoringControlEnable capturing CPU timing. It does not effect whether monitoring is enabled.WARNING: turning on CPU timing will adversly impact on system performance. Do not do this on production systems without due consideration.
- Specified by:
enableCpuTimingin interfaceConfluenceMonitoringControl
-
disableCpuTiming
public void disableCpuTiming()
Description copied from interface:ConfluenceMonitoringControlDisable capturing CPU timing. It does not effect whether monitoring is enabled.- Specified by:
disableCpuTimingin interfaceConfluenceMonitoringControl
-
enableHibernateMonitoring
public void enableHibernateMonitoring()
Description copied from interface:ConfluenceMonitoringControlEnables Hibernate monitoring. It does not effect whether monitoring is enabled.- Specified by:
enableHibernateMonitoringin interfaceConfluenceMonitoringControl
-
disableHibernateMonitoring
public void disableHibernateMonitoring()
Description copied from interface:ConfluenceMonitoringControlDisable Hibernate monitoring. It does not effect whether monitoring is enabled.- Specified by:
disableHibernateMonitoringin interfaceConfluenceMonitoringControl
-
clear
public void clear()
Description copied from interface:ConfluenceMonitoringControlClears the currently held statistics.- Specified by:
clearin interfaceConfluenceMonitoringControl
-
snapshotCounters
public @NonNull List<CounterSnapshot> snapshotCounters()
Description copied from interface:ConfluenceMonitoringControlReturns a snapshot of the counters.- Specified by:
snapshotCountersin interfaceConfluenceMonitoringControl- Returns:
- a mutable list of the current counters.
-
snapshotTimers
public @NonNull List<TimerSnapshot> snapshotTimers()
Description copied from interface:ConfluenceMonitoringControlReturns a snapshot of the timers.- Specified by:
snapshotTimersin interfaceConfluenceMonitoringControl- Returns:
- a mutable list of the current timers.
-
-