@Internal @ParametersAreNonnullByDefault public class AtlassianInstrumentationConfluenceMonitoring extends Object implements ConfluenceMonitoring, ConfluenceMonitoringControl, AtlassianInstrumentationControl
Constructor and Description |
---|
AtlassianInstrumentationConfluenceMonitoring() |
AtlassianInstrumentationConfluenceMonitoring(int maxEntries) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the currently held statistics.
|
String |
createName(String name,
String... optional)
Creates a legal name from the supplied mandatory suggestion, and optional extra parts.
|
void |
disableAllMonitoring() |
void |
disableCpuTiming()
Disable capturing CPU timing.
|
void |
disableHibernateMonitoring()
Disable Hibernate monitoring.
|
void |
disableMonitoring()
Disable monitoring.
|
void |
enableCpuTiming()
Enable capturing CPU timing.
|
void |
enableHibernateMonitoring()
Enables Hibernate monitoring.
|
void |
enableMonitoring()
Enables monitoring.
|
Counter |
fetchCounter(String name,
String... optional)
Fetches the counter associated with the supplied name details.
|
boolean |
isCpuTimingEnabled() |
boolean |
isMonitoringEnabled() |
void |
resetOpTimerFactorySupplier()
Resets the supplier of
OpTimerFactory instances used by the monitoring implementation back to the default. |
void |
setOpTimerFactorySupplier(com.atlassian.util.concurrent.Supplier<com.atlassian.instrumentation.operations.OpTimerFactory> opTimerFactorySupplier)
Provide a new supplier of
OpTimerFactory instances to be used by the monitoring implementation. |
List<CounterSnapshot> |
snapshotCounters()
Returns a snapshot of the counters.
|
List<TimerSnapshot> |
snapshotTimers()
Returns a snapshot of the timers.
|
Split |
startSplit(String name,
String... optional)
Creates and starts a split timer associated with the supplied name details.
|
public AtlassianInstrumentationConfluenceMonitoring()
public AtlassianInstrumentationConfluenceMonitoring(int maxEntries)
@PostConstruct public void disableAllMonitoring() throws Exception
Exception
public void setOpTimerFactorySupplier(com.atlassian.util.concurrent.Supplier<com.atlassian.instrumentation.operations.OpTimerFactory> opTimerFactorySupplier)
AtlassianInstrumentationControl
OpTimerFactory
instances to be used by the monitoring implementation.
Callers should ensure that monitoring is currently disabled before calling this, or the operation will fail.setOpTimerFactorySupplier
in interface AtlassianInstrumentationControl
opTimerFactorySupplier
- a supplier of OpTimerFactory instances to be usedConfluenceMonitoringControl.enableMonitoring()
,
ConfluenceMonitoringControl.disableMonitoring()
,
ConfluenceMonitoringControl.isMonitoringEnabled()
public void resetOpTimerFactorySupplier()
AtlassianInstrumentationControl
OpTimerFactory
instances used by the monitoring implementation back to the default.
Callers should ensure that monitoring is currently disabled before calling this, or the operation will fail.@Nonnull public Counter fetchCounter(String name, String... optional)
ConfluenceMonitoring
ConfluenceMonitoring.createName(String, String...)
.fetchCounter
in interface ConfluenceMonitoring
name
- the mandatory suggested nameoptional
- the optional parts to concatenate with the mandatory
suggestion@Nonnull public Split startSplit(String name, String... optional)
ConfluenceMonitoring
ConfluenceMonitoring.createName(String, String...)
.
The typical usage is:
final Split split = instance.startSplit("name"); try { // code to execute } finally { split.close(); }
Under Java 7, the following is also possible:
try (Split split = instance.startSplit("name")) { // code to execute }
startSplit
in interface ConfluenceMonitoring
name
- the mandatory suggested nameoptional
- the optional parts to concatenate with the mandatory
suggestion@Nonnull public String createName(String name, String... optional)
ConfluenceMonitoring
The method is provided for the case where the caller wants to pre-compute the name. For example, it maybe more efficient to generate the name once, to be re-used many times. Typically, this method will not be used.
The algorithm used is very simple:
null
or a blank string,
they are replaced with an empty string.
"."
separator.
<UNKNOWN>
is returned instead.createName
in interface ConfluenceMonitoring
name
- the mandatory suggested nameoptional
- the optional parts to concatenate with the mandatory
suggestionpublic boolean isMonitoringEnabled()
isMonitoringEnabled
in interface ConfluenceMonitoringControl
public void enableMonitoring()
ConfluenceMonitoringControl
enableMonitoring
in interface ConfluenceMonitoringControl
public void disableMonitoring()
ConfluenceMonitoringControl
disableMonitoring
in interface ConfluenceMonitoringControl
public boolean isCpuTimingEnabled()
isCpuTimingEnabled
in interface ConfluenceMonitoringControl
public void enableCpuTiming()
ConfluenceMonitoringControl
WARNING: turning on CPU timing will adversly impact on system performance. Do not do this on production systems without due consideration.
enableCpuTiming
in interface ConfluenceMonitoringControl
public void disableCpuTiming()
ConfluenceMonitoringControl
disableCpuTiming
in interface ConfluenceMonitoringControl
public void enableHibernateMonitoring()
ConfluenceMonitoringControl
enableHibernateMonitoring
in interface ConfluenceMonitoringControl
public void disableHibernateMonitoring()
ConfluenceMonitoringControl
disableHibernateMonitoring
in interface ConfluenceMonitoringControl
public void clear()
ConfluenceMonitoringControl
clear
in interface ConfluenceMonitoringControl
@Nonnull public List<CounterSnapshot> snapshotCounters()
ConfluenceMonitoringControl
snapshotCounters
in interface ConfluenceMonitoringControl
@Nonnull public List<TimerSnapshot> snapshotTimers()
ConfluenceMonitoringControl
snapshotTimers
in interface ConfluenceMonitoringControl
Copyright © 2003–2016 Atlassian. All rights reserved.