| 1 |
= ranch:info(3) |
| 2 |
|
| 3 |
== Name |
| 4 |
|
| 5 |
ranch:info - Overview of Ranch listeners |
| 6 |
|
| 7 |
== Description |
| 8 |
|
| 9 |
[source,erlang] |
| 10 |
---- |
| 11 |
info() -> #{Ref := Info} |
| 12 |
info(Ref) -> Info |
| 13 |
|
| 14 |
Info :: #{Key :: atom() := Value :: any()} |
| 15 |
---- |
| 16 |
|
| 17 |
Overview of Ranch listeners. |
| 18 |
|
| 19 |
== Arguments |
| 20 |
|
| 21 |
Ref:: |
| 22 |
|
| 23 |
The listener name. |
| 24 |
|
| 25 |
== Return value |
| 26 |
|
| 27 |
Returns detailed information about one or all |
| 28 |
Ranch listeners. The following keys are returned: |
| 29 |
|
| 30 |
pid:: Pid of the listener's top-level supervisor. |
| 31 |
status:: Listener status, either running or suspended. |
| 32 |
ip:: Interface Ranch listens on. |
| 33 |
port:: Port number Ranch listens on. |
| 34 |
max_connections:: Maximum number of connections per connection supervisor. |
| 35 |
active_connections:: Number of active connections. |
| 36 |
all_connections:: Number of connections, including those removed from the count. |
| 37 |
transport:: Transport module. |
| 38 |
transport_options:: Transport options. |
| 39 |
protocol:: Protocol module. |
| 40 |
protocol_options:: Protocol options. |
| 41 |
metrics:: Listener metrics. |
| 42 |
|
| 43 |
== Metrics |
| 44 |
|
| 45 |
Listener metrics are provided as a map, with the following keys: |
| 46 |
|
| 47 |
{conns_sup, Index, accept}:: Number of accepted connections, per connection supervisor. |
| 48 |
{conns_sup, Index, terminate}:: Number of terminated connection processes, per connection supervisor. |
| 49 |
|
| 50 |
== Changelog |
| 51 |
|
| 52 |
* *2.1*: Added accept/terminate metrics to the output of `ranch:info/0,1`. |
| 53 |
* *2.0*: The listener info is now returned as a map. |
| 54 |
* *2.0*: The `num_acceptors` key has been removed. |
| 55 |
|
| 56 |
== Examples |
| 57 |
|
| 58 |
.Get information about all listeners |
| 59 |
[source,erlang] |
| 60 |
---- |
| 61 |
AllInfo = ranch:info(). |
| 62 |
---- |
| 63 |
|
| 64 |
.Get information about a specific listener |
| 65 |
[source,erlang] |
| 66 |
---- |
| 67 |
Info = ranch:info(example). |
| 68 |
---- |
| 69 |
|
| 70 |
== See also |
| 71 |
|
| 72 |
link:man:ranch:get_addr(3)[ranch:get_addr(3)], |
| 73 |
link:man:ranch:get_port(3)[ranch:get_port(3)], |
| 74 |
link:man:ranch:procs(3)[ranch:procs(3)], |
| 75 |
link:man:ranch(3)[ranch(3)] |