Package com.atlassian.confluence.event
Class TimingEventPublisher
java.lang.Object
com.atlassian.confluence.event.TimingEventPublisher
- All Implemented Interfaces:
com.atlassian.event.api.EventListenerRegistrar
,com.atlassian.event.api.EventPublisher
@ThreadSafe
@Internal
public class TimingEventPublisher
extends Object
implements com.atlassian.event.api.EventPublisher
An
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.- Since:
- 5.5.5
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TimingEventPublisher
create
(com.atlassian.event.api.EventPublisher delegate) void
void
void
unregister
(Object listener) void
-
Field Details
-
EVENT_PUBLISH_WARN_THRESHOLD_SYSTEM_PROPERTY
System property to configure the maximum time for a publish attempt to complete before logging warnings. -
EVENT_PUBLISH_WARN_THRESHOLD_DEFAULT
Default for the maximum time for a publish attempt to complete before logging warnings. 5 seconds.
-
-
Method Details
-
create
-
register
- Specified by:
register
in interfacecom.atlassian.event.api.EventListenerRegistrar
-
unregister
- Specified by:
unregister
in interfacecom.atlassian.event.api.EventListenerRegistrar
-
unregisterAll
public void unregisterAll()- Specified by:
unregisterAll
in interfacecom.atlassian.event.api.EventListenerRegistrar
-
publish
- Specified by:
publish
in interfacecom.atlassian.event.api.EventPublisher
-