NervesHubLink.Extensions.Health (nerves_hub_link v2.7.0)

View Source

The Health Extension.

Provides metrics, metadata and alarms to allow building an understanding of the operational state of a device. The device's "health". This information is reported over the extensions mechanism to NervesHub for display, alerting and more.

Summary

Functions

Returns a specification to start this module under a supervisor.

Confirms if a health report has been sent.

Request a health report be sent asynchronously.

Functions

check_health(default_report \\ DefaultReport)

@spec check_health(module()) :: NervesHubLink.Extensions.Health.DeviceStatus.t() | nil

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

push(event, payload)

@spec push(String.t(), map()) ::
  {:ok, Slipstream.push_reference()} | {:error, reason :: :detached | term()}

report_sent?()

@spec report_sent?() :: boolean()

Confirms if a health report has been sent.

Examples

iex> NervesHubLink.Extensions.Health.report_sent?()
false

iex> NervesHubLink.Extensions.Health.send_report()
:ok

iex> NervesHubLink.Extensions.Health.report_sent?()
true

send_report()

@spec send_report() :: :ok

Request a health report be sent asynchronously.

Examples

iex> NervesHubLink.Extensions.Health.send_report()
:ok

start_link(opts)