Merge pull request #12388 from qzhuyan/dev/william/per-listn-conn-cnt

feat: quic per listener conn count
This commit is contained in:
JianBo He 2024-01-26 09:01:39 +08:00 committed by GitHub
commit e29a80d568
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 8 deletions

View File

@ -24,7 +24,7 @@ IsQuicSupp = fun() ->
end, end,
Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}}, 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 = fun(Config) ->
{dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, 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}); esockd:get_current_connections({listener_id(Type, Name), ListenOn});
current_conns(Type, Name, _ListenOn) when Type =:= ws; Type =:= wss -> current_conns(Type, Name, _ListenOn) when Type =:= ws; Type =:= wss ->
proplists:get_value(all_connections, ranch:info(listener_id(Type, Name))); proplists:get_value(all_connections, ranch:info(listener_id(Type, Name)));
current_conns(quic, _Name, _ListenOn) -> current_conns(quic, Name, _ListenOn) ->
case quicer:perf_counters() of {ok, LPid} = quicer:listener(listener_id(quic, Name)),
{ok, PerfCnts} -> proplists:get_value(conn_active, PerfCnts); quicer_listener:count_conns(LPid);
_ -> 0
end;
current_conns(_, _, _) -> current_conns(_, _, _) ->
{error, not_support}. {error, not_support}.

2
changes/feat-12388.en.md Normal file
View File

@ -0,0 +1,2 @@
QUIC listener now shows per listener connection count instead of global one.

View File

@ -795,7 +795,7 @@ defmodule EMQXUmbrella.MixProject do
defp quicer_dep() do defp quicer_dep() do
if enable_quicer?(), if enable_quicer?(),
# in conflict with emqx and emqtt # 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: [] else: []
end end

View File

@ -36,7 +36,7 @@ assert_otp() ->
end. end.
quicer() -> 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() ->
{jq, {git, "https://github.com/emqx/jq", {tag, "v0.3.12"}}}. {jq, {git, "https://github.com/emqx/jq", {tag, "v0.3.12"}}}.