public class Instrumentation extends Object implements Startable
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.
InstrumentationName
,
DefaultInstrumentRegistry
Constructor and Description |
---|
Instrumentation(VelocityRequestContextFactory velocityRequestContextFactory,
DatabaseConfigurationLoader databaseConfigurationLoader,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
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> |
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.
|
public Instrumentation(VelocityRequestContextFactory velocityRequestContextFactory, DatabaseConfigurationLoader databaseConfigurationLoader, com.atlassian.event.api.EventPublisher eventPublisher)
public static com.atlassian.instrumentation.Instrument putInstrument(com.atlassian.instrumentation.Instrument instrument)
public static com.atlassian.instrumentation.Instrument getInstrument(String name)
public static com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(String name)
public static com.atlassian.instrumentation.AbsoluteCounter pullAbsoluteCounter(InstrumentationName instrumentationName)
public static com.atlassian.instrumentation.Counter pullCounter(String name)
public static com.atlassian.instrumentation.Counter pullCounter(InstrumentationName instrumentationName)
public static com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(String name)
public static com.atlassian.instrumentation.DerivedCounter pullDerivedCounter(InstrumentationName instrumentationName)
public static com.atlassian.instrumentation.Gauge pullGauge(String name)
public static com.atlassian.instrumentation.Gauge pullGauge(InstrumentationName instrumentationName)
public static com.atlassian.instrumentation.operations.OpCounter pullOpCounter(String name)
public static com.atlassian.instrumentation.operations.OpCounter pullOpCounter(InstrumentationName instrumentationName)
public static com.atlassian.instrumentation.operations.OpTimer pullTimer(String name)
public static com.atlassian.instrumentation.operations.OpTimer pullTimer(InstrumentationName instrumentationName)
public static List<com.atlassian.instrumentation.Instrument> snapshotInstruments()
public static List<com.atlassian.instrumentation.operations.OpSnapshot> snapshotThreadLocalOperationsAndClear(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory)
public static List<com.atlassian.instrumentation.operations.OpSnapshot> snapshotThreadLocalOperations(com.atlassian.instrumentation.operations.OpTimerFactory opTimerFactory)
Copyright © 2002-2019 Atlassian. All Rights Reserved.