public interface

InstrumentationListenerManager

com.atlassian.jira.instrumentation.InstrumentationListenerManager
Known Indirect Subclasses

Class Overview

Manager that handles calling registered listeners to send data to the analytics package.

Summary

Public Methods
void addRequestListener(RequestListener listener)
Add a listener
void applyToAllListeners(Consumer<RequestListener> apply)
Apply function to each listener.
@Nonnull String getCurrentPath()
@Nonnull String getCurrentTraceId()
void processOnEndListeners(String path, String traceId, Optional<Long> requestTime)
Runs all the registered RequestListeners at the end of the Request processing.
void processOnStartListeners()
Runs all the registered RequestListeners at the beginning of the Request processing.
void removeRequestListener(RequestListener listener)
Remove a listener.

Public Methods

public void addRequestListener (RequestListener listener)

Add a listener

Parameters
listener The listener to add.

public void applyToAllListeners (Consumer<RequestListener> apply)

Apply function to each listener.

Parameters
apply Run a function on each listener.

@Nonnull public String getCurrentPath ()

Returns
  • the path of the current request (applies to the current thread).

@Nonnull public String getCurrentTraceId ()

Returns
  • the trace ID of the current request (applies to the current thread).

public void processOnEndListeners (String path, String traceId, Optional<Long> requestTime)

Runs all the registered RequestListeners at the end of the Request processing.

Parameters
path The request path
traceId If the request has an X-B3-traceId header then we use this as the unique ID.
requestTime An @{link Optional} that may contain the request time.

public void processOnStartListeners ()

Runs all the registered RequestListeners at the beginning of the Request processing.

public void removeRequestListener (RequestListener listener)

Remove a listener.

Parameters
listener The listener to remove.