Добавлена оперативная и историческая статистика нод и узлов mnesia #22
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user