Package rife.engine
Record Class SseHistoryStats
java.lang.Object
java.lang.Record
rife.engine.SseHistoryStats
- Record Components:
capacity- the configured history capacitybuffered- the number of events that are currently bufferedoldestId- the sequence number of the oldest buffered event; or0when nothing is buffered. This is the bare number, while the ID that clients see also carries the broadcaster's epochnewestId- the sequence number of the most recently sent event; or0when nothing has been sent yet, in the same bare form asoldestIdreplays- the number of reconnections whose missed events were replayed from the historygaps- the number of reconnections that couldn't be replayed since the events had already been evicted, or since the last received ID originated from a previous application instancemaxMissedEvents- the largest number of events that any reconnecting client had missed, only counting the reconnections whose ID this broadcaster instance could still relate to its own history
public record SseHistoryStats(int capacity, int buffered, long oldestId, long newestId, long replays, long gaps, long maxMissedEvents)
extends Record
Provides a snapshot of the state of the event history of an
SseBroadcaster, which is intended to help you tune the history
capacity.
The most important numbers for tuning are gaps, which counts
the reconnections that couldn't be fully served since the events had
already been evicted from the history, and maxMissedEvents, which
is the largest number of events that any reconnecting client had missed.
A capacity of about twice the maximum miss will cover every reconnection
that has been observed so far.
Note that the IDs in this snapshot are the bare sequence numbers that the broadcaster counts with, while the IDs that clients send back also carry the epoch of the broadcaster instance, so that they can't be compared to each other directly.
- Since:
- 1.10
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSseHistoryStats(int capacity, int buffered, long oldestId, long newestId, long replays, long gaps, long maxMissedEvents) Creates an instance of aSseHistoryStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbuffered()Returns the value of thebufferedrecord component.intcapacity()Returns the value of thecapacityrecord component.final booleanIndicates whether some other object is "equal to" this one.longgaps()Returns the value of thegapsrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of themaxMissedEventsrecord component.longnewestId()Returns the value of thenewestIdrecord component.longoldestId()Returns the value of theoldestIdrecord component.longreplays()Returns the value of thereplaysrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
SseHistoryStats
public SseHistoryStats(int capacity, int buffered, long oldestId, long newestId, long replays, long gaps, long maxMissedEvents) Creates an instance of aSseHistoryStatsrecord class.- Parameters:
capacity- the value for thecapacityrecord componentbuffered- the value for thebufferedrecord componentoldestId- the value for theoldestIdrecord componentnewestId- the value for thenewestIdrecord componentreplays- the value for thereplaysrecord componentgaps- the value for thegapsrecord componentmaxMissedEvents- the value for themaxMissedEventsrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
capacity
public int capacity()Returns the value of thecapacityrecord component.- Returns:
- the value of the
capacityrecord component
-
buffered
public int buffered()Returns the value of thebufferedrecord component.- Returns:
- the value of the
bufferedrecord component
-
oldestId
public long oldestId()Returns the value of theoldestIdrecord component.- Returns:
- the value of the
oldestIdrecord component
-
newestId
public long newestId()Returns the value of thenewestIdrecord component.- Returns:
- the value of the
newestIdrecord component
-
replays
public long replays()Returns the value of thereplaysrecord component.- Returns:
- the value of the
replaysrecord component
-
gaps
public long gaps()Returns the value of thegapsrecord component.- Returns:
- the value of the
gapsrecord component
-
maxMissedEvents
public long maxMissedEvents()Returns the value of themaxMissedEventsrecord component.- Returns:
- the value of the
maxMissedEventsrecord component
-