ranch:info(3)

NAME

ranch:info - Overview of Ranch listeners

DESCRIPTION
    info() -> #{Ref := Info}
    info(Ref) -> Info

    Info :: #{Key :: atom() := Value :: any()}

Overview of Ranch listeners.

ARGUMENTS

Ref
    The listener name.

RETURN VALUE

Returns detailed information about one or all Ranch listeners. The following keys are returned:

pid
    Pid of the listener's top-level supervisor.

status
    Listener status, either running or suspended.

ip
    Interface Ranch listens on.

port
    Port number Ranch listens on.

max_connections
    Maximum number of connections per connection supervisor.

active_connections
    Number of active connections.

all_connections
    Number of connections, including those removed from the count.

transport
    Transport module.

transport_options
    Transport options.

protocol
    Protocol module.

protocol_options
    Protocol options.

metrics
    Listener metrics.

METRICS

Listener metrics are provided as a map, with the following keys:

{conns_sup, Index, accept}
    Number of accepted connections, per connection supervisor.

{conns_sup, Index, terminate}
    Number of terminated connection processes, per connection supervisor.

CHANGELOG
    • 2.1: Added accept/terminate metrics to the output of ranch:info/0,1.
    • 2.0: The listener info is now returned as a map.
    • 2.0: The num_acceptors key has been removed.

EXAMPLES

Get information about all listeners
    AllInfo = ranch:info().

Get information about a specific listener
    Info = ranch:info(example).

SEE ALSO

ranch:get_addr(3), ranch:get_port(3), ranch:procs(3), ranch(3)