Imp.Observability.Status (Imp v0.13.0)

Copy Markdown View Source

Normalized status for long-running Imp work.

The artifact is ordinary immutable data suitable for terminal UIs, LiveViews, telemetry consumers, and tests. completed and total are optional because some providers expose a phase before they expose a work estimate.

:succeeded_with_errors is work that finished and returned its result but recorded failures on the way, such as an optimizer report whose errors is not empty.

Summary

Types

t()

@type t() :: %Imp.Observability.Status{
  completed: non_neg_integer() | nil,
  message: String.t(),
  metadata: map(),
  phase: atom() | String.t(),
  state:
    :pending
    | :running
    | :succeeded
    | :succeeded_with_errors
    | :failed
    | :cancelled
    | :unknown,
  total: non_neg_integer() | nil
}