Просмотр исходного кода

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

feat: quic per listener conn count
JianBo He 2 лет назад
Родитель
Сommit
e29a80d568
5 измененных файлов с 8 добавлено и 8 удалено
  1. 1 1
      apps/emqx/rebar.config.script
  2. 3 5
      apps/emqx/src/emqx_listeners.erl
  3. 2 0
      changes/feat-12388.en.md
  4. 1 1
      mix.exs
  5. 1 1
      rebar.config.erl

+ 1 - 1
apps/emqx/rebar.config.script

@@ -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),

+ 3 - 5
apps/emqx/src/emqx_listeners.erl

@@ -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}.
 

+ 2 - 0
changes/feat-12388.en.md

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

+ 1 - 1
mix.exs

@@ -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
 

+ 1 - 1
rebar.config.erl

@@ -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"}}}.