Botica.Doctor.Reporter (Botica v2.2.0)

Copy Markdown View Source

Result aggregation and reporting for Botica.Doctor.

Splits out the reporting helpers from Botica.Doctor so the doctor remains focused on orchestration.

Not part of the public API — used only by Botica.Doctor.

Summary

Functions

Derives an overall health status from a summary.

Aggregates check results into a summary map.

Functions

derive_status(arg1)

@spec derive_status(map()) :: :ok | :degraded | :fail

Derives an overall health status from a summary.

Returns :ok if all pass, :degraded if some warnings, :fail if any error.

summary(results)

@spec summary([map()]) :: %{
  ok: non_neg_integer(),
  warning: non_neg_integer(),
  error: non_neg_integer(),
  total: non_neg_integer(),
  passed?: boolean()
}

Aggregates check results into a summary map.

Returns %{ok: n, warning: n, error: n, total: n, passed?: boolean}.