diff --git a/src/quic/sdlan_quic_channel.erl b/src/quic/sdlan_quic_channel.erl index ad80fda..14827b4 100644 --- a/src/quic/sdlan_quic_channel.erl +++ b/src/quic/sdlan_quic_channel.erl @@ -40,7 +40,6 @@ %% 心跳间隔 heartbeat_sec = 10, ping_timer :: undefined | reference(), - metrics_timer :: undefined | reference(), stream_active_n = ?STREAM_ACTIVE_N, stream :: undefined | quicer:stream_handle(), @@ -131,7 +130,7 @@ handle_event(cast, accept_stream, initializing, State=#state{conn = Conn, stream logger:debug("[sdlan_quic_channel] call do_init of conn: ~p", [Conn]), case quicer:async_accept_stream(Conn, #{active => StreamActiveN}) of {ok, _} -> - {next_state, waiting_stream, schedule_metrics(State)}; + {next_state, waiting_stream, State}; {error, Reason} -> {stop, {accept_stream_failed, Reason}, State} end; @@ -398,13 +397,6 @@ handle_event(info, {timeout, TimerRef, ping_ticker}, _, State = #state{ping_time handle_event(info, {timeout, _TimerRef, ping_ticker}, _, State) -> {keep_state, State}; -handle_event(info, {timeout, TimerRef, metrics_ticker}, StateName, State = #state{metrics_timer = TimerRef}) -> - log_metrics(StateName, State), - {keep_state, schedule_metrics(State#state{metrics_timer = undefined})}; - -handle_event(info, {timeout, _TimerRef, metrics_ticker}, _StateName, State) -> - {keep_state, State}; - %% 发送指令信息 handle_event(cast, {send_event, Event}, registered, #state{stream = Stream}) -> quic_send(Stream, <>), @@ -504,15 +496,6 @@ heartbeat_ms(HeartbeatSec) when is_integer(HeartbeatSec), HeartbeatSec > 0 -> heartbeat_ms(_) -> ?PING_TICKER. -schedule_metrics(State = #state{metrics_timer = undefined}) -> - State#state{metrics_timer = erlang:start_timer(?METRICS_TICKER, self(), metrics_ticker)}; -schedule_metrics(State) -> - State. - -log_metrics(StateName, State = #state{client_id = ClientId, network_id = NetworkId}) -> - Info = debug_info(StateName, State), - logger:debug("[sdlan_quic_channel] metrics client_id: ~p, network_id: ~p, metrics: ~p", [ClientId, NetworkId, Info]). - debug_info(StateName, #state{ client_id = ClientId, network_id = NetworkId,