Wayfarer.Target.TotalConnections (wayfarer v0.6.4)

View Source

A simple ETS table that tracks the total number of requests for each target.

Summary

Functions

Returns a specification to start this module under a supervisor.

Increment the health check connection counter for the specified target.

Increment the proxy connection counter for the specified target.

Return the total number of proxy requests for the provided targets.

Return the total number of requests for the provided targets.

Types

state()

@type state() :: %{table: :ets.tid(), timer: :timer.tref()}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

health_check_connect(target)

@spec health_check_connect(Wayfarer.Router.target()) :: :ok

Increment the health check connection counter for the specified target.

proxy_connect(target)

@spec proxy_connect(Wayfarer.Router.target()) :: :ok

Increment the proxy connection counter for the specified target.

proxy_count(targets)

@spec proxy_count(Wayfarer.Router.target() | [Wayfarer.Router.target()]) :: %{
  required(Wayfarer.Router.target()) => non_neg_integer()
}

Return the total number of proxy requests for the provided targets.

request_count(targets)

@spec request_count(Wayfarer.Router.target() | [Wayfarer.Router.target()]) :: %{
  required(Wayfarer.Router.target()) => %{
    proxied: non_neg_integer(),
    health_checks: non_neg_integer()
  }
}

Return the total number of requests for the provided targets.