@Internal @ParametersAreNonnullByDefault public class AtlassianInstrumentationConfluenceMonitoring extends Object implements ConfluenceMonitoring, ConfluenceMonitoringControl
Constructor and Description |
---|
AtlassianInstrumentationConfluenceMonitoring(ControllableInstrumentRegistry registry,
MutableRegistryConfiguration registryConfiguration) |
AtlassianInstrumentationConfluenceMonitoring(int maxEntries,
ControllableInstrumentRegistry registry,
MutableRegistryConfiguration registryConfiguration) |
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() |
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(ControllableInstrumentRegistry registry, MutableRegistryConfiguration registryConfiguration)
public AtlassianInstrumentationConfluenceMonitoring(int maxEntries, ControllableInstrumentRegistry registry, MutableRegistryConfiguration registryConfiguration)
@PostConstruct public void disableAllMonitoring() throws Exception
Exception
@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–2017 Atlassian. All rights reserved.