Class EventCountCircuitBreaker.CheckIntervalData
- java.lang.Object
-
- org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.CheckIntervalData
-
- Enclosing class:
- EventCountCircuitBreaker
private static final class EventCountCircuitBreaker.CheckIntervalData extends java.lang.ObjectAn internally used data class holding information about the checks performed by this class. Basically, the number of received events and the start time of the current check interval are stored.
-
-
Field Summary
Fields Modifier and Type Field Description private longcheckIntervalStartThe start time of the current check interval.private inteventCountThe counter for events.
-
Constructor Summary
Constructors Constructor Description CheckIntervalData(int count, long intervalStart)Creates a new instance ofEventCountCircuitBreaker.CheckIntervalData.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCheckIntervalStart()Gets the start time of the current check interval.intgetEventCount()Gets the event counter.EventCountCircuitBreaker.CheckIntervalDataincrement(int delta)Returns a new instance ofEventCountCircuitBreaker.CheckIntervalDatawith the event counter incremented by the given delta.
-
-
-
Constructor Detail
-
CheckIntervalData
CheckIntervalData(int count, long intervalStart)Creates a new instance ofEventCountCircuitBreaker.CheckIntervalData.- Parameters:
count- the current count valueintervalStart- the start time of the check interval
-
-
Method Detail
-
getCheckIntervalStart
public long getCheckIntervalStart()
Gets the start time of the current check interval.- Returns:
- the check interval start time
-
getEventCount
public int getEventCount()
Gets the event counter.- Returns:
- the number of received events
-
increment
public EventCountCircuitBreaker.CheckIntervalData increment(int delta)
Returns a new instance ofEventCountCircuitBreaker.CheckIntervalDatawith the event counter incremented by the given delta. If the delta is 0, this object is returned.- Parameters:
delta- the delta- Returns:
- the updated instance
-
-