public class

Instrumentation

extends Object
implements Startable
java.lang.Object
   ↳ com.atlassian.jira.instrumentation.Instrumentation

Class Overview

A static singleton style class that exposes com.atlassian.instrumentation.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 com.atlassian.instrumentation.operations.OpCounter called "some.operation". Simple.

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

See Also

Summary

Public Constructors
Instrumentation(VelocityRequestContextFactory velocityRequestContextFactory, DatabaseConfigurationLoader databaseConfigurationLoader)
Public Methods
static Instrument getInstrument(String name)
static AbsoluteCounter pullAbsoluteCounter(String name)
static AbsoluteCounter pullAbsoluteCounter(InstrumentationName instrumentationName)
static Counter pullCounter(InstrumentationName instrumentationName)
static Counter pullCounter(String name)
static DerivedCounter pullDerivedCounter(String name)
static DerivedCounter pullDerivedCounter(InstrumentationName instrumentationName)
static Gauge pullGauge(InstrumentationName instrumentationName)
static Gauge pullGauge(String name)
static OpCounter pullOpCounter(InstrumentationName instrumentationName)
static OpCounter pullOpCounter(String name)
static OpTimer pullTimer(InstrumentationName instrumentationName)
static OpTimer pullTimer(String name)
static Instrument putInstrument(Instrument instrument)
static List<Instrument> snapshotInstruments()
static List<OpSnapshot> snapshotThreadLocalOperationsAndClear(OpTimerFactory opTimerFactory)
void start()
This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.extension.Startable

Public Constructors

public Instrumentation (VelocityRequestContextFactory velocityRequestContextFactory, DatabaseConfigurationLoader databaseConfigurationLoader)

Public Methods

public static Instrument getInstrument (String name)

public static AbsoluteCounter pullAbsoluteCounter (String name)

public static AbsoluteCounter pullAbsoluteCounter (InstrumentationName instrumentationName)

public static Counter pullCounter (InstrumentationName instrumentationName)

public static Counter pullCounter (String name)

public static DerivedCounter pullDerivedCounter (String name)

public static DerivedCounter pullDerivedCounter (InstrumentationName instrumentationName)

public static Gauge pullGauge (InstrumentationName instrumentationName)

public static Gauge pullGauge (String name)

public static OpCounter pullOpCounter (InstrumentationName instrumentationName)

public static OpCounter pullOpCounter (String name)

public static OpTimer pullTimer (InstrumentationName instrumentationName)

public static OpTimer pullTimer (String name)

public static Instrument putInstrument (Instrument instrument)

public static List<Instrument> snapshotInstruments ()

public static List<OpSnapshot> snapshotThreadLocalOperationsAndClear (OpTimerFactory opTimerFactory)

public void start ()

This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.