Добавлена оперативная и историческая статистика нод и узлов mnesia #22

This commit is contained in:
2026-05-28 18:59:21 +03:00
parent 29fe0386be
commit f507d08e2c
16 changed files with 753 additions and 201 deletions
+2
View File
@@ -55,6 +55,7 @@ init(Req, _Opts) ->
websocket_init(#state{user_id = UserId} = State) ->
pg:join(eventhub_ws, self()),
io:format("[WS] User ~s connected~n", [UserId]),
core_counters:inc(ws_connections),
{ok, State#state{subscriptions = []}}.
-spec websocket_handle(term(), #state{}) ->
@@ -99,6 +100,7 @@ websocket_info(_Info, State) ->
-spec terminate(term(), cowboy_req:req(), #state{}) -> ok.
terminate(_Reason, _Req, #state{user_id = UserId}) ->
pg:leave(eventhub_ws, self()),
core_counters:dec(ws_connections),
io:format("[WS] User ~s disconnected~n", [UserId]),
ok.