ExUtcp.Monitoring.HealthCheck (ex_utcp v0.3.2)

Copy Markdown View Source

Health check system for ExUtcp components.

Monitors the health of transports, providers, and connections.

Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the current health status.

Registers a custom health check.

Forces a health check run.

Starts the health check system.

Unregisters a health check.

Types

check_result()

@type check_result() :: %{
  name: String.t(),
  status: health_status(),
  message: String.t(),
  duration_ms: integer(),
  timestamp: integer()
}

health_status()

@type health_status() :: :healthy | :degraded | :unhealthy

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_health_status()

@spec get_health_status() :: map()

Gets the current health status.

register_check(name, check_function)

@spec register_check(String.t(), (-> check_result())) :: :ok

Registers a custom health check.

run_health_checks()

@spec run_health_checks() :: map()

Forces a health check run.

start_link(opts \\ [])

@spec start_link(keyword()) :: {:ok, pid()} | {:error, term()}

Starts the health check system.

unregister_check(name)

@spec unregister_check(String.t()) :: :ok

Unregisters a health check.