fix: ignore unwanted results

This commit is contained in:
EMQ-YangM 2022-04-28 15:02:07 +08:00
parent 6530604f40
commit 5b0ee30d72
2 changed files with 9 additions and 8 deletions

View File

@ -638,7 +638,8 @@ do_authenticate([#authenticator{id = ID, provider = Provider, state = State} | M
{ok, _} ->
emqx_plugin_libs_metrics:inc(authn_metrics, ID, success);
{error, _} ->
emqx_plugin_libs_metrics:inc(authn_metrics, ID, failed)
emqx_plugin_libs_metrics:inc(authn_metrics, ID, failed);
_ -> ok
end,
{stop, Result}
catch

View File

@ -326,9 +326,9 @@ test_authenticator_users(PathPrefix) ->
} = jiffy:decode(PageData0, [return_maps]);
["listeners",'tcp:default'] ->
#{ <<"metrics">> := #{
<<"matched">> := 3,
<<"success">> := 1,
<<"ignore">> := 2
<<"matched">> := 1,
<<"success">> := 0,
<<"ignore">> := 1
}
} = jiffy:decode(PageData0, [return_maps])
end,
@ -380,9 +380,9 @@ test_authenticator_users(PathPrefix) ->
} = jiffy:decode(PageData01, [return_maps]);
["listeners",'tcp:default'] ->
#{ <<"metrics">> := #{
<<"matched">> := 4,
<<"success">> := 2,
<<"ignore">> := 2
<<"matched">> := 2,
<<"success">> := 1,
<<"ignore">> := 1
}
} = jiffy:decode(PageData01, [return_maps])
end,