com.atlassian.confluence.util.profiling
Class AtlassianInstrumentationConfluenceMonitoring

java.lang.Object
  extended by com.atlassian.confluence.util.profiling.AtlassianInstrumentationConfluenceMonitoring
All Implemented Interfaces:
ConfluenceMonitoring, ConfluenceMonitoringControl, org.springframework.beans.factory.InitializingBean

@Internal
@ParametersAreNonnullByDefault
public class AtlassianInstrumentationConfluenceMonitoring
extends Object
implements ConfluenceMonitoring, org.springframework.beans.factory.InitializingBean, ConfluenceMonitoringControl


Constructor Summary
AtlassianInstrumentationConfluenceMonitoring(int maxEntries)
           
 
Method Summary
 void afterPropertiesSet()
           
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtlassianInstrumentationConfluenceMonitoring

public AtlassianInstrumentationConfluenceMonitoring(int maxEntries)
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

fetchCounter

@Nonnull
public Counter fetchCounter(String name,
                                    String... optional)
Description copied from interface: ConfluenceMonitoring
Fetches the counter associated with the supplied name details. The name is constructed calling ConfluenceMonitoring.createName(String, String...).

Specified by:
fetchCounter in interface ConfluenceMonitoring
Parameters:
name - the mandatory suggested name
optional - the optional parts to concatenate with the mandatory suggestion
Returns:
the counter associated with the name.

startSplit

@Nonnull
public Split startSplit(String name,
                                String... optional)
Description copied from interface: ConfluenceMonitoring
Creates and starts a split timer associated with the supplied name details. The name is constructed calling 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
 }
 

Specified by:
startSplit in interface ConfluenceMonitoring
Parameters:
name - the mandatory suggested name
optional - the optional parts to concatenate with the mandatory suggestion
Returns:
the running split timer

createName

@Nonnull
public String createName(String name,
                                 String... optional)
Description copied from interface: ConfluenceMonitoring
Creates a legal name from the supplied mandatory suggestion, and optional extra parts.

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:


isMonitoringEnabled

public boolean isMonitoringEnabled()
Specified by:
isMonitoringEnabled in interface ConfluenceMonitoringControl
Returns:
whether monitoring is enabled.

enableMonitoring

public void enableMonitoring()
Description copied from interface: ConfluenceMonitoringControl
Enables monitoring. It does not effect whether CPU timing is enabled.

Specified by:
enableMonitoring in interface ConfluenceMonitoringControl

disableMonitoring

public void disableMonitoring()
Description copied from interface: ConfluenceMonitoringControl
Disable monitoring. It does not effect whether CPU timing is enabled.

Specified by:
disableMonitoring in interface ConfluenceMonitoringControl

isCpuTimingEnabled

public boolean isCpuTimingEnabled()
Specified by:
isCpuTimingEnabled in interface ConfluenceMonitoringControl
Returns:
whether CPU timing is enabled.

enableCpuTiming

public void enableCpuTiming()
Description copied from interface: ConfluenceMonitoringControl
Enable 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:
enableCpuTiming in interface ConfluenceMonitoringControl

disableCpuTiming

public void disableCpuTiming()
Description copied from interface: ConfluenceMonitoringControl
Disable capturing CPU timing. It does not effect whether monitoring is enabled.

Specified by:
disableCpuTiming in interface ConfluenceMonitoringControl

enableHibernateMonitoring

public void enableHibernateMonitoring()
Description copied from interface: ConfluenceMonitoringControl
Enables Hibernate monitoring. It does not effect whether monitoring is enabled.

Specified by:
enableHibernateMonitoring in interface ConfluenceMonitoringControl

disableHibernateMonitoring

public void disableHibernateMonitoring()
Description copied from interface: ConfluenceMonitoringControl
Disable Hibernate monitoring. It does not effect whether monitoring is enabled.

Specified by:
disableHibernateMonitoring in interface ConfluenceMonitoringControl

clear

public void clear()
Description copied from interface: ConfluenceMonitoringControl
Clears the currently held statistics.

Specified by:
clear in interface ConfluenceMonitoringControl

snapshotCounters

@Nonnull
public List<CounterSnapshot> snapshotCounters()
Description copied from interface: ConfluenceMonitoringControl
Returns a snapshot of the counters.

Specified by:
snapshotCounters in interface ConfluenceMonitoringControl
Returns:
a mutable list of the current counters.

snapshotTimers

@Nonnull
public List<TimerSnapshot> snapshotTimers()
Description copied from interface: ConfluenceMonitoringControl
Returns a snapshot of the timers.

Specified by:
snapshotTimers in interface ConfluenceMonitoringControl
Returns:
a mutable list of the current timers.


Copyright © 2003–2015 Atlassian. All rights reserved.