Decides whether a session is saved, from the :keep configuration.
A session matching errors: true or slower_than: ms is always saved.
Otherwise a session without user interaction is discarded, and the
:rate share of the rest is saved. See "Tail sampling" in
PhoenixReplay.Config.
The decision only ever turns from discard to keep as events arrive: once
a session is kept, later events cannot discard it. That lets
PhoenixReplay.Session.Monitor start writing a running session to
storage as soon as it is kept, observing its events incrementally with
observe/3 and decision/3.
Summary
Functions
Decides for a whole recording. See decision/3.
Decides from an observation, given a uniform draw in 0.0..1.0 for
:rate.
An observation of no events.
Adds events to an observation.
Types
Functions
@spec decide(PhoenixReplay.Recording.t(), PhoenixReplay.Config.keep(), float()) :: :keep | {:discard, reason()}
Decides for a whole recording. See decision/3.
@spec decision(observation(), PhoenixReplay.Config.keep(), float()) :: :keep | {:discard, reason()}
Decides from an observation, given a uniform draw in 0.0..1.0 for
:rate.
A session is interactive once it handled an event, navigated within the
LiveView, that is, after more than its initial handle_params/3, had a
form control changed, or changed client state it had reported before;
see PhoenixReplay.Capture.State.
@spec new() :: observation()
An observation of no events.
@spec observe( observation(), [PhoenixReplay.Recording.Event.t()], PhoenixReplay.Config.keep() ) :: observation()
Adds events to an observation.