PropertyDamage.Progress (PropertyDamage v0.2.0)
View SourceThe progress-projection envelope (DR-022).
A %PropertyDamage.Progress{} is a derived projection of an operation's
authoritative state at a checkpoint, fanned out to consumers (the verbose:
printer, a user on_progress: callback, telemetry). It carries cross-cutting
metadata plus an operation-specific :data payload.
The payload's struct type is the discriminator — there is deliberately no
kind/operation field, because both are derivable from the payload and
carrying them would invite drift. classify/1 is the single site that maps a
payload struct to its {operation, kind}.
Progress is a view of authoritative state, never its source: results and
metrics are authoritative (an operation's return value), and a terminal
*Result payload carries a copy of that result for consumers.
Summary
Functions
Whether a progress value is an intermediate update or a terminal result.
Wrap a payload struct in a progress envelope.
The operation a progress value belongs to.
The telemetry event name for a progress value:
[:property_damage, operation, kind].
Types
@type kind() :: :progress | :result
@type operation() :: :test_run | :load_test | :mutation | :differential
@type payload() :: PropertyDamage.Progress.RunUpdate.t() | PropertyDamage.Progress.RunResult.t() | PropertyDamage.Progress.ReplayUpdate.t() | PropertyDamage.Progress.LoadUpdate.t() | PropertyDamage.Progress.LoadResult.t() | PropertyDamage.Progress.MutationUpdate.t() | PropertyDamage.Progress.MutationResult.t() | PropertyDamage.Progress.DifferentialUpdate.t() | PropertyDamage.Progress.DifferentialResult.t()
@type t() :: %PropertyDamage.Progress{ at: integer() | nil, data: payload(), elapsed_ms: non_neg_integer() | nil, run_id: term() }
Functions
Whether a progress value is an intermediate update or a terminal result.
Wrap a payload struct in a progress envelope.
Options: :at (system time when projected), :elapsed_ms (since the
operation started), :run_id (correlation id for the operation invocation).
The operation a progress value belongs to.
The telemetry event name for a progress value:
[:property_damage, operation, kind].