fix(emqx_st_statistics): fix initial value error (#6224)

* fix(emqx_st_statistics): fix initial value error
This commit is contained in:
lafirest 2021-11-21 18:55:43 +08:00 committed by GitHub
parent 7de0891201
commit 4767b41eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -56,8 +56,8 @@
}. }.
-record(slow_log, { topic :: emqx_types:topic() -record(slow_log, { topic :: emqx_types:topic()
, count :: pos_integer() , count :: integer() %% 0 will be used in initial value
, elapsed :: pos_integer() , elapsed :: integer()
}). }).
-type message() :: #message{}. -type message() :: #message{}.
@ -233,8 +233,8 @@ update_log(#message{topic = Topic}, Elapsed) ->
Topic, Topic,
[{#slow_log.count, 1}, {#slow_log.elapsed, Elapsed}], [{#slow_log.count, 1}, {#slow_log.elapsed, Elapsed}],
#slow_log{topic = Topic, #slow_log{topic = Topic,
count = 1, count = 0,
elapsed = Elapsed}), elapsed = 0}),
ok. ok.
-spec do_notification(state()) -> true. -spec do_notification(state()) -> true.