From c59dcb9c6cd935491f06ace65d746cbf8eec26c3 Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:03:40 +0100 Subject: [PATCH] fix(verify_sequence): Don't report repeats as negative numbers --- src/behaviors/emqttb_behavior_sub.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/behaviors/emqttb_behavior_sub.erl b/src/behaviors/emqttb_behavior_sub.erl index 8391b7f..c02f189 100644 --- a/src/behaviors/emqttb_behavior_sub.erl +++ b/src/behaviors/emqttb_behavior_sub.erl @@ -210,7 +210,7 @@ verify_sequence(#{ number_of_gaps := NGaps, gap_size := GapSize, number_of_repea [{_, OldSeqNo}] -> logger:info("Repeat detected: ~p ~p; ~p", [OldSeqNo, SeqNo, Key]), emqttb_metrics:counter_inc(NRepeats, 1), - emqttb_metrics:rolling_average_observe(RepeatSize, SeqNo - OldSeqNo + 1) + emqttb_metrics:rolling_average_observe(RepeatSize, OldSeqNo - SeqNo + 1) end, ets:insert(?seq_tab, {Key, SeqNo}).