Juggernaut.Report (Juggernaut v0.4.0)

Copy Markdown View Source

Writes the HTML dashboard of recorded runs (mix juggernaut.report, design notes §3, §11): reads the selected run, the run recorded before it and the history, builds the data document (Juggernaut.Report.Data) and writes the page (Juggernaut.Report.Html) atomically.

Trends use at most limit history records, ending with the selected run when the history holds it (so an earlier run is shown with the runs before it), else the newest.

Summary

Functions

At most limit history records, oldest first, ending with run_id's record when the history holds it, else with the newest.

The run recorded just before run_id, or nil when there is none or it is unreadable.

Writes the dashboard for the project in ctx and returns the path written. opts: run (a run reference, default the latest), limit (history records, default 50) and output (a path, relative to the project root; default _build/juggernaut/report/index.html).

Functions

history(store, run_id, limit)

@spec history(Path.t(), String.t(), pos_integer()) :: [map()]

At most limit history records, oldest first, ending with run_id's record when the history holds it, else with the newest.

previous(store, run_id)

@spec previous(Path.t(), String.t()) :: Juggernaut.Run.t() | nil

The run recorded just before run_id, or nil when there is none or it is unreadable.

write(ctx, opts)

@spec write(Juggernaut.CLI.Task.ctx(), keyword()) ::
  {:ok, Path.t()} | {:error, Juggernaut.Error.t()}

Writes the dashboard for the project in ctx and returns the path written. opts: run (a run reference, default the latest), limit (history records, default 50) and output (a path, relative to the project root; default _build/juggernaut/report/index.html).