@ThreadSafe @Internal public class TimingEventPublisher extends Object implements com.atlassian.event.api.EventPublisher
EventPublisher
implementation that times how long it takes to publish an event,
and logs a warning if the time is above a threshold. Warnings are not started until the object receives an
ApplicationStartedEvent
, to avoid warnings during the startup process
which are known to produce slow events.Modifier and Type | Field and Description |
---|---|
static org.joda.time.Duration |
EVENT_PUBLISH_WARN_THRESHOLD_DEFAULT
Default for the maximum time for a publish attempt to complete before logging warnings.
|
static String |
EVENT_PUBLISH_WARN_THRESHOLD_SYSTEM_PROPERTY
System property to configure the maximum time for a publish attempt to complete before logging warnings.
|
Modifier and Type | Method and Description |
---|---|
static TimingEventPublisher |
create(com.atlassian.event.api.EventPublisher delegate) |
void |
publish(Object event) |
void |
register(Object listener) |
void |
unregister(Object listener) |
void |
unregisterAll() |
public static final String EVENT_PUBLISH_WARN_THRESHOLD_SYSTEM_PROPERTY
public static final org.joda.time.Duration EVENT_PUBLISH_WARN_THRESHOLD_DEFAULT
public static TimingEventPublisher create(com.atlassian.event.api.EventPublisher delegate)
public void register(Object listener)
register
in interface com.atlassian.event.api.EventListenerRegistrar
public void unregister(Object listener)
unregister
in interface com.atlassian.event.api.EventListenerRegistrar
public void unregisterAll()
unregisterAll
in interface com.atlassian.event.api.EventListenerRegistrar
public void publish(Object event)
publish
in interface com.atlassian.event.api.EventPublisher
Copyright © 2003–2020 Atlassian. All rights reserved.