mirror of
https://github.com/seriyps/mtproto_proxy.git
synced 2026-08-04 07:08:10 +00:00
Fix metrics call to ranch:info()
Bug was introduced when we upgraded to ranch 2.x.x in
fc9ec1d326
This commit is contained in:
parent
dfa991f803
commit
f2bdf3cb7f
3 changed files with 3 additions and 3 deletions
|
|
@ -808,5 +808,5 @@ Helpers
|
|||
Number of connections
|
||||
|
||||
```bash
|
||||
/opt/mtp_proxy/bin/mtp_proxy eval 'lists:sum([proplists:get_value(all_connections, L) || {_, L} <- ranch:info()]).'
|
||||
/opt/mtp_proxy/bin/mtp_proxy eval 'lists:sum([maps:get(all_connections, L) || {_, L} <- maps:to_list(ranch:info())]).'
|
||||
```
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ passive_metrics() ->
|
|||
|
|
||||
[{gauge, [?APP, connections, count],
|
||||
"Count of ranch connections",
|
||||
[{#{listener => H}, proplists:get_value(all_connections, P)}
|
||||
[{#{listener => H}, maps:get(all_connections, P)}
|
||||
|| {H, P} <- mtproto_proxy_app:mtp_listeners()]}] ].
|
||||
|
||||
-spec active_metrics() -> [{metric_type(), metric_name(), metric_doc(), Opts}]
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ diff_env(NewEnv, OldEnv) ->
|
|||
|
||||
|
||||
%% @doc List of ranch listeners running mtproto_proxy
|
||||
-spec mtp_listeners() -> [tuple()].
|
||||
-spec mtp_listeners() -> [{ranch:ref(), #{atom() => term()}}].
|
||||
mtp_listeners() ->
|
||||
maps:to_list(
|
||||
maps:filter(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue