Add WS stats

This commit is contained in:
turtled 2018-08-27 16:15:23 +08:00
parent a183693ac8
commit 35d821a62e
2 changed files with 5 additions and 3 deletions

View File

@ -59,7 +59,9 @@
'subscribers/count',
'subscribers/max',
'subscriptions/count',
'subscriptions/max'
'subscriptions/max',
'subscriptions/shared/count',
'subscriptions/shared/max'
]).
-define(ROUTE_STATS, [

View File

@ -131,9 +131,9 @@ stat_fun() ->
fun() -> {ok, get(recv_oct)} end.
websocket_handle({binary, <<>>}, State) ->
{ok, State};
{ok, ensure_stats_timer(State)};
websocket_handle({binary, [<<>>]}, State) ->
{ok, State};
{ok, ensure_stats_timer(State)};
websocket_handle({binary, Data}, State = #state{parser_state = ParserState,
proto_state = ProtoState}) ->
BinSize = iolist_size(Data),