Class Instrumentation
java.lang.Object
com.atlassian.jira.instrumentation.Instrumentation
- All Implemented Interfaces:
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
DefaultInstrumentRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionInstrumentation
(VelocityRequestContextFactory velocityRequestContextFactory, DatabaseConfigurationLoader databaseConfigurationLoader, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
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
static com.atlassian.instrumentation.Instrument
putInstrument
(com.atlassian.instrumentation.Instrument instrument) static List<com.atlassian.instrumentation.Instrument>
static List<com.atlassian.instrumentation.operations.OpSnapshot>
snapshotThreadLocalOperations
(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory) static List<com.atlassian.instrumentation.operations.OpSnapshot>
snapshotThreadLocalOperationsAndClear
(com.atlassian.instrumentation.operations.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.
-
Constructor Details
-
Instrumentation
public Instrumentation(VelocityRequestContextFactory velocityRequestContextFactory, DatabaseConfigurationLoader databaseConfigurationLoader, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
putInstrument
public static com.atlassian.instrumentation.Instrument putInstrument(com.atlassian.instrumentation.Instrument instrument) -
getInstrument
-
pullAbsoluteCounter
-
pullAbsoluteCounter
public static com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(InstrumentationName instrumentationName) -
pullCounter
-
pullCounter
public static com.atlassian.instrumentation.Counter pullCounter(InstrumentationName instrumentationName) -
pullDerivedCounter
-
pullDerivedCounter
public static com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(InstrumentationName instrumentationName) -
pullGauge
-
pullGauge
public static com.atlassian.instrumentation.Gauge pullGauge(InstrumentationName instrumentationName) -
pullOpCounter
-
pullOpCounter
public static com.atlassian.instrumentation.operations.OpCounter pullOpCounter(InstrumentationName instrumentationName) -
pullTimer
-
pullTimer
public static com.atlassian.instrumentation.operations.OpTimer pullTimer(InstrumentationName instrumentationName) -
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.
-