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:
-
InstrumentationNameDefaultInstrumentRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionInstrumentation(VelocityRequestContextFactory velocityRequestContextFactory, DatabaseConfigurationLoader databaseConfigurationLoader, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionstatic com.atlassian.instrumentation.InstrumentgetInstrument(String name) static com.atlassian.instrumentation.AbsoluteCounterpullAbsoluteCounter(InstrumentationName instrumentationName) static com.atlassian.instrumentation.AbsoluteCounterpullAbsoluteCounter(String name) static com.atlassian.instrumentation.CounterpullCounter(InstrumentationName instrumentationName) static com.atlassian.instrumentation.CounterpullCounter(String name) static com.atlassian.instrumentation.DerivedCounterpullDerivedCounter(InstrumentationName instrumentationName) static com.atlassian.instrumentation.DerivedCounterpullDerivedCounter(String name) static com.atlassian.instrumentation.GaugepullGauge(InstrumentationName instrumentationName) static com.atlassian.instrumentation.Gaugestatic com.atlassian.instrumentation.operations.OpCounterpullOpCounter(InstrumentationName instrumentationName) static com.atlassian.instrumentation.operations.OpCounterpullOpCounter(String name) static com.atlassian.instrumentation.operations.OpTimerpullTimer(InstrumentationName instrumentationName) static com.atlassian.instrumentation.operations.OpTimerstatic com.atlassian.instrumentation.InstrumentputInstrument(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) voidstart()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:StartableThis method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
-