com.atlassian.jira.instrumentation
Class Instrumentation

java.lang.Object
  extended by com.atlassian.jira.instrumentation.Instrumentation
All Implemented Interfaces:
Startable

public class Instrumentation
extends Object
implements Startable

A static singleton style class that exposes DefaultInstrumentRegistry functionality. You can instrument JIRA code something like this


  OpTimer timer = Instrumentation.pullTimer("some.operation");
  try {
      ... some operation in JIRA
      ...
  } finally {
      timer.end();
  }
 

This will cause invocation count and time taken information to be stored away in a OpCounter called "some.operation". Simple.

You do not have to worry about recording this data, it will be done for you later.

Since:
v5.0
See Also:
InstrumentationName, \

Constructor Summary
Instrumentation()
           
 
Method Summary
static com.atlassian.instrumentation.Instrument getInstrument(String name)
           
static com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(InstrumentationName instrumentationName)
           
static com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(String name)
           
static com.atlassian.instrumentation.Counter pullCounter(InstrumentationName instrumentationName)
           
static com.atlassian.instrumentation.Counter pullCounter(String name)
           
static com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(InstrumentationName instrumentationName)
           
static com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(String name)
           
static com.atlassian.instrumentation.Gauge pullGauge(InstrumentationName instrumentationName)
           
static com.atlassian.instrumentation.Gauge pullGauge(String name)
           
static com.atlassian.instrumentation.operations.OpCounter pullOpCounter(InstrumentationName instrumentationName)
           
static com.atlassian.instrumentation.operations.OpCounter pullOpCounter(String name)
           
static com.atlassian.instrumentation.operations.OpTimer pullTimer(InstrumentationName instrumentationName)
           
static com.atlassian.instrumentation.operations.OpTimer pullTimer(String name)
           
static com.atlassian.instrumentation.Instrument putInstrument(com.atlassian.instrumentation.Instrument instrument)
           
static List<com.atlassian.instrumentation.Instrument> snapshotInstruments()
           
static List<com.atlassian.instrumentation.operations.OpSnapshot> snapshotThreadLocalOperationsAndClear()
           
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instrumentation

public Instrumentation()
Method Detail

putInstrument

public static com.atlassian.instrumentation.Instrument putInstrument(com.atlassian.instrumentation.Instrument instrument)

getInstrument

public static com.atlassian.instrumentation.Instrument getInstrument(String name)

pullAbsoluteCounter

public static com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(String name)

pullAbsoluteCounter

public static com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(InstrumentationName instrumentationName)

pullCounter

public static com.atlassian.instrumentation.Counter pullCounter(String name)

pullCounter

public static com.atlassian.instrumentation.Counter pullCounter(InstrumentationName instrumentationName)

pullDerivedCounter

public static com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(String name)

pullDerivedCounter

public static com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(InstrumentationName instrumentationName)

pullGauge

public static com.atlassian.instrumentation.Gauge pullGauge(String name)

pullGauge

public static com.atlassian.instrumentation.Gauge pullGauge(InstrumentationName instrumentationName)

pullOpCounter

public static com.atlassian.instrumentation.operations.OpCounter pullOpCounter(String name)

pullOpCounter

public static com.atlassian.instrumentation.operations.OpCounter pullOpCounter(InstrumentationName instrumentationName)

pullTimer

public static com.atlassian.instrumentation.operations.OpTimer pullTimer(String name)

pullTimer

public static com.atlassian.instrumentation.operations.OpTimer pullTimer(InstrumentationName instrumentationName)

snapshotInstruments

public static List<com.atlassian.instrumentation.Instrument> snapshotInstruments()

snapshotThreadLocalOperationsAndClear

public static List<com.atlassian.instrumentation.operations.OpSnapshot> snapshotThreadLocalOperationsAndClear()

start

public void start()
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable


Copyright © 2002-2012 Atlassian. All Rights Reserved.