Package com.linecorp.armeria.common.util
Interface EventCounter
A counter that counts events as success or failure.
-
Method Summary
Modifier and TypeMethodDescriptioncount()
Returns the currentEventCount
.static EventCounter
ofSlidingWindow
(Ticker ticker, Duration slidingWindow, Duration updateInterval) Returns a newEventCounter
that counts events within a sliding window.static EventCounter
ofSlidingWindow
(Duration slidingWindow, Duration updateInterval) Returns a newEventCounter
that counts events within a sliding window.Counts failure events.Counts success events.
-
Method Details
-
ofSlidingWindow
Returns a newEventCounter
that counts events within a sliding window. -
ofSlidingWindow
Returns a newEventCounter
that counts events within a sliding window. -
count
EventCount count()Returns the currentEventCount
. -
onSuccess
Counts success events.- Returns:
- the current
EventCount
if it has been updated, ornull
otherwise.
-
onFailure
Counts failure events.- Returns:
- the current
EventCount
if it has been updated, ornull
otherwise.
-