Merge pull request #7047 from EMQ-YangM/main-v4.4
fix(emqx_rule_metrics): add a function for code hot upgrade
This commit is contained in:
commit
f55419f2a5
|
@ -340,7 +340,7 @@ code_change({down, _Vsn}, State = #state{metric_ids = MIDs}, [Vsn]) ->
|
||||||
Exception = get_actions_exception(Id),
|
Exception = get_actions_exception(Id),
|
||||||
Retry = get_actions_retry(Id),
|
Retry = get_actions_retry(Id),
|
||||||
ok = delete_counters(Id),
|
ok = delete_counters(Id),
|
||||||
ok = create_counters(Id, 7),
|
ok = create_counters(Id, max_counters_size_old()),
|
||||||
inc_rules_matched(Id, Passed),
|
inc_rules_matched(Id, Passed),
|
||||||
inc_actions_taken(Id, Take),
|
inc_actions_taken(Id, Take),
|
||||||
inc_actions_success(Id, Success),
|
inc_actions_success(Id, Success),
|
||||||
|
@ -464,6 +464,9 @@ precision(Float, N) ->
|
||||||
%% Metrics Definitions
|
%% Metrics Definitions
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% for code hot upgrade
|
||||||
|
max_counters_size_old() -> 7.
|
||||||
|
|
||||||
max_counters_size() -> 11.
|
max_counters_size() -> 11.
|
||||||
|
|
||||||
metrics_idx('rules.matched') -> 1;
|
metrics_idx('rules.matched') -> 1;
|
||||||
|
|
Loading…
Reference in New Issue