fix(quic): Per listener conn count

This commit is contained in:
William Yang 2024-01-24 21:36:25 +01:00
parent a8eefe808f
commit 9fb6688801
4 changed files with 6 additions and 8 deletions

View File

@ -24,7 +24,7 @@ IsQuicSupp = fun() ->
end,
Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.312"}}}.
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.313"}}}.
Dialyzer = fun(Config) ->
{dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, Config),

View File

@ -182,11 +182,9 @@ current_conns(Type, Name, ListenOn) when Type == tcp; Type == ssl ->
esockd:get_current_connections({listener_id(Type, Name), ListenOn});
current_conns(Type, Name, _ListenOn) when Type =:= ws; Type =:= wss ->
proplists:get_value(all_connections, ranch:info(listener_id(Type, Name)));
current_conns(quic, _Name, _ListenOn) ->
case quicer:perf_counters() of
{ok, PerfCnts} -> proplists:get_value(conn_active, PerfCnts);
_ -> 0
end;
current_conns(quic, Name, _ListenOn) ->
{ok, LPid} = quicer:listener(listener_id(quic, Name)),
quicer_listener:count_conns(LPid);
current_conns(_, _, _) ->
{error, not_support}.

View File

@ -795,7 +795,7 @@ defmodule EMQXUmbrella.MixProject do
defp quicer_dep() do
if enable_quicer?(),
# in conflict with emqx and emqtt
do: [{:quicer, github: "emqx/quic", tag: "0.0.312", override: true}],
do: [{:quicer, github: "emqx/quic", tag: "0.0.313", override: true}],
else: []
end

View File

@ -36,7 +36,7 @@ assert_otp() ->
end.
quicer() ->
{quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.312"}}}.
{quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.313"}}}.
jq() ->
{jq, {git, "https://github.com/emqx/jq", {tag, "v0.3.12"}}}.