Class RecentInteractions
java.lang.Object
com.vaadin.observability.micrometer.insights.RecentInteractions
Bounded in-memory ring buffer of captured interactions. Oldest entries are
evicted first; memory use is hard-capped by
capacity.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault hard cap on retained interactions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(CapturedInteraction interaction) latest()The latest interaction, ornullwhen none has been recorded.voidrecordLatest(int requestId, LatestInteraction interaction, boolean propertySync) Records the invocation that just ended as the latest interaction.snapshot()Returns a snapshot, newest first.
-
Field Details
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITYDefault hard cap on retained interactions.- See Also:
-
-
Constructor Details
-
RecentInteractions
public RecentInteractions(int capacity)
-
-
Method Details
-
add
-
snapshot
Returns a snapshot, newest first. -
recordLatest
Records the invocation that just ended as the latest interaction.One user action is often several invocations in one request - a text field's value sync ahead of the button click that submits it - so an invocation from the same request as the previous one is folded into it: the server time adds up, and a property sync does not replace the event the user actually triggered as the headline.
- Parameters:
requestId- identifies the request the invocation arrived ininteraction- the invocation, as a latest interaction of its ownpropertySync- whether the invocation was a property sync
-
latest
The latest interaction, ornullwhen none has been recorded. Application-wide for now, from whichever UI interacted last.- Returns:
- the latest interaction, or
null
-