public abstract class AbstractOncePerPeriodPublisher<T extends CrowdAnalyticsEvent> extends AbstractEventListener
Modifier and Type | Field and Description |
---|---|
protected Clock |
clock |
protected Map<T,AtomicLong> |
counters |
protected AtomicLong |
lastCountersResetTimestamp |
protected long |
reportIntervalMillis |
protected long |
threshold |
eventPublisher
Constructor and Description |
---|
AbstractOncePerPeriodPublisher(com.atlassian.event.api.EventPublisher eventPublisher,
Clock clock,
Iterable<T> allKeys) |
AbstractOncePerPeriodPublisher(com.atlassian.event.api.EventPublisher eventPublisher,
Clock clock,
Iterable<T> allKeys,
long threshold,
long reportIntervalMillis) |
Modifier and Type | Method and Description |
---|---|
protected void |
maybePublish(T event) |
protected void |
maybePublish(T event,
Supplier<Boolean> shouldPublish) |
protected void |
resetCounters() |
protected void |
resetCountersIfNeeded() |
register, unregister
protected final long threshold
protected final long reportIntervalMillis
protected final Map<T extends CrowdAnalyticsEvent,AtomicLong> counters
protected final AtomicLong lastCountersResetTimestamp
protected final Clock clock
Copyright © 2021 Atlassian. All rights reserved.