Class Instrumentation

java.lang.Object
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:
  • Constructor Details

  • Method Details

    • 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(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory)
    • snapshotThreadLocalOperations

      public static List<com.atlassian.instrumentation.operations.OpSnapshot> snapshotThreadLocalOperations(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory)
    • start

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