Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix modMucMamFlushed metric #3023

Merged
merged 1 commit into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion big_tests/tests/mam_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,15 @@ init_per_testcase(C=muc_querying_for_all_messages_with_jid, Config) ->
muc_bootstrap_archive(start_alice_room(Config1)));
init_per_testcase(C=muc_archive_request, Config) ->
Config1 = escalus_fresh:create_users(Config, [{alice, 1}, {bob, 1}]),
escalus:init_per_testcase(C, start_alice_room(Config1));
Config2 = %% Check that metric is incremented on MUC flushed
case ?config(configuration, Config1) of
rdbms_async_pool ->
MongooseMetrics = [{['_', 'modMucMamFlushed'], changed}],
[{mongoose_metrics, MongooseMetrics} | Config1];
_ ->
Config1
end,
escalus:init_per_testcase(C, start_alice_room(Config2));
init_per_testcase(C=muc_no_elements, Config) ->
rpc_apply(gen_mod, set_module_opts, [host(), mod_mam_muc, [no_stanzaid_element]]),
Config1 = escalus_fresh:create_users(Config, [{alice, 1}, {bob, 1}]),
Expand Down
1 change: 1 addition & 0 deletions src/metrics/mongoose_metrics_definitions.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
modMucMamLookups,
modMucMamForwarded,
modMucMamArchived,
modMucMamFlushed,
modMucMamSinglePurges,
modMucMamMultiplePurges,
modCSIInactive,
Expand Down
3 changes: 2 additions & 1 deletion src/metrics/mongoose_metrics_mam_hooks.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ get_hooks(Host) ->
[mam_muc_get_prefs, Host, ?MODULE, mam_muc_get_prefs, 50],
[mam_muc_archive_message, Host, ?MODULE, mam_muc_archive_message, 50],
[mam_muc_remove_archive, Host, ?MODULE, mam_muc_remove_archive, 50],
[mam_muc_lookup_messages, Host, ?MODULE, mam_muc_lookup_messages, 100]
[mam_muc_lookup_messages, Host, ?MODULE, mam_muc_lookup_messages, 100],
[mam_muc_flush_messages, Host, ?MODULE, mam_muc_flush_messages, 50]
].

-spec mam_get_prefs(Result :: any(),
Expand Down