NervesHubLink.Extensions.Health.Report behaviour (nerves_hub_link v2.7.3)

View Source

Behaviour for implementing a custom health report.

The NervesHubLink.Extensions.Health.DefaultReport has a lot of easy customization options available. If you want an entirely custom report or need exact control over how the generation of data happens then using this gives you that possibility.

Summary

Callbacks

alarms()

@callback alarms() :: %{required(String.t()) => String.t()}

checks()

@callback checks() :: %{required(String.t()) => %{pass: boolean(), note: String.t()}}

connectivity()

@callback connectivity() :: %{
  required(NervesHubLink.Extensions.Health.DeviceStatus.interface_identifer()) =>
    %{
      type: NervesHubLink.Extensions.Health.DeviceStatus.interface_type(),
      present: boolean(),
      state: atom(),
      connection_status:
        NervesHubLink.Extensions.Health.DeviceStatus.connection_status(),
      metrics: %{required(String.t()) => number()},
      metadata: %{required(String.t()) => String.t()}
    }
}

metadata()

@callback metadata() :: %{required(String.t()) => String.t()}

metrics()

@callback metrics() :: %{required(String.t()) => number()}

timestamp()

@callback timestamp() :: DateTime.t()