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

Instrument mod_pubsub #4297

Merged
merged 5 commits into from
Jun 13, 2024
Merged

Instrument mod_pubsub #4297

merged 5 commits into from
Jun 13, 2024

Conversation

gustawlippa
Copy link
Contributor

@gustawlippa gustawlippa commented Jun 11, 2024

This PR instruments mod_pubsub. Luckily, it war fairly straightforward.

I wasn't sure how to represent the event names without creating new atoms, which is why there is a new "table" in pubsub code, but I think it's OK, because: 1. It follows the style of the module (https://github.com/esl/MongooseIM/pull/4297/files#diff-8f3c86211cc3400d551754d19d3dbb12cecce86b38fe9f6ca2a7f2a2c87f5f05L1366 for example) 2. This way should be fast.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jun 11, 2024

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 3c2dda5
Reports root/ big
OK: 456 / Failed: 1 / User-skipped: 41 / Auto-skipped: 0

mam_SUITE:cassandra_muc_all:muc_prefs_cases:muc_prefs_set_cdata_request
{error,
  {function_clause,
    [{mam_helper,parse_children_prefs_iq,
       [{xmlel,<<"error">>,
          [{<<"code">>,<<"501">>},{<<"type">>,<<"cancel">>}],
          [{xmlel,<<"feature-not-implemented">>,
             [{<<"xmlns">>,
             <<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
             []},
           {xmlel,<<"text">>,
             [{<<"xmlns">>,
             <<"urn:ietf:params:xml:ns:xmpp-stanzas">>}],
             [{xmlcdata,<<"From mod_mam_muc">>}]}]},
        {prefs_result_iq,undefined,[],[]}],
       []},
     {lists,foldl,3,[{file,"lists.erl"},{line,1594}]},
     {mam_SUITE,'-muc_prefs_set_cdata_request/1-fun-0-',2,
       [{file,"/home/circleci/project/big_tests/tests/mam_SUITE.erl"},
        {line,3457}]},
     {escalus_story,story,4,
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
        {line,72}]},
     {muc_helper,story_with_room,4,
       [{file,"/home/circleci/project/big_tests/tests/muc_helper.erl"},
        {line,318}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
     {test_server,run_test_case_eval1,6,
       [{file,"test_server.erl"},{line,1302}]},
     {test_server,run_test_case_eval,9,
       [{file,"test_server.erl"},{line,1234}]}]}}

Report log


small_tests_25 / small_tests / 3c2dda5
Reports root / small


small_tests_26 / small_tests / 3c2dda5
Reports root / small


small_tests_26_arm64 / small_tests / 3c2dda5
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 3c2dda5
Reports root/ big
OK: 2290 / Failed: 0 / User-skipped: 905 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 3c2dda5
Reports root/ big
OK: 4622 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 3c2dda5
Reports root/ big
OK: 2290 / Failed: 0 / User-skipped: 905 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 3c2dda5
Reports root/ big
OK: 4589 / Failed: 0 / User-skipped: 138 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 3c2dda5
Reports root/ big
OK: 4622 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 3c2dda5
Reports root/ big
OK: 4519 / Failed: 0 / User-skipped: 174 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 3c2dda5
Reports root/ big
OK: 5013 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 3c2dda5
Reports root/ big
OK: 2430 / Failed: 0 / User-skipped: 765 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 3c2dda5
Reports root/ big
OK: 4619 / Failed: 0 / User-skipped: 108 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 3c2dda5
Reports root/ big
OK: 4991 / Failed: 1 / User-skipped: 133 / Auto-skipped: 0

carboncopy_SUITE:one2one:dropped_client_doesnt_create_duplicate_carbons
{error,
  {{badmatch,
     [{xmlel,<<"message">>,
        [{<<"from">>,
        <<"alice_dropped_client_doesnt_create_duplicate_carbons_603@localhost">>},
         {<<"to">>,
        <<"alice_dropped_client_doesnt_create_duplicate_carbons_603@localhost/res2">>},
         {<<"xmlns">>,<<"jabber:client">>},
         {<<"type">>,<<"chat">>}],
        [{xmlel,<<"sent">>,
           [{<<"xmlns">>,<<"urn:xmpp:carbons:2">>}],
           [{xmlel,<<"forwarded">>,
            [{<<"xmlns">>,<<"urn:xmpp:forward:0">>}],
            [{xmlel,<<"message">>,
               [{<<"from">>,
                 <<"alice_dropped_client_doesnt_create_duplicate_carbons_603@localhost/res1">>},
                {<<"type">>,<<"chat">>},
                {<<"to">>,
                 <<"bob_dropped_client_doesnt_create_duplicate_carbons_603@localhost/res1">>},
                {<<"xmlns">>,<<"jabber:client">>}],
               [{xmlel,<<"body">>,[],
                  [{xmlcdata,
                     <<"And pious action">>}]}]}]}]}]}]},
   [{carboncopy_SUITE,
      '-dropped_client_doesnt_create_duplicate_carbons/1-fun-0-',4,
      [{file,
         "/home/circleci/project/big_tests/tests/carboncopy_SUITE.erl"},
       {line,189}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_serv...

Report log


pgsql_mnesia_26 / pgsql_mnesia / 3c2dda5
Reports root/ big
OK: 5013 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 3c2dda5
Reports root/ big
OK: 5010 / Failed: 0 / User-skipped: 115 / Auto-skipped: 0


elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 3c2dda5
Reports root/ big
OK: 457 / Failed: 0 / User-skipped: 41 / Auto-skipped: 0


elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 3c2dda5
Reports root/ big
OK: 457 / Failed: 0 / User-skipped: 41 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 3c2dda5
Reports root/ big
OK: 4992 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 3c2dda5
Reports root/ big
OK: 4991 / Failed: 0 / User-skipped: 133 / Auto-skipped: 1

mam_SUITE:rdbms_mnesia_cache_muc_all:muc_prefs_cases:muc_query_get_request
{skip,
  {failed,
    {mam_SUITE,init_per_testcase,
      {{badrpc,
         {'EXIT',
           {{badkey,mod_mam_mnesia_prefs},
            [{maps,get,
               [mod_mam_mnesia_prefs,
              #{mod_vcard =>
                  #{matches => 30,
                  host => {prefix,<<"vjud.">>},
                  search => true,iqdisc => parallel,
                  backend => rdbms},
                mod_roster =>
                  #{iqdisc => one_queue,backend => rdbms,
                  versioning => false,
                  store_current_id => false},
                mod_register =>
                  #{access => register,iqdisc => one_queue,
                  registration_watchers => [],
                  password_strength => 0,
                  ip_access =>
                    [{allow,"127.0.0.0/8"},
                     {deny,"0.0.0.0/0"}]},
                mod_sic => #{iqdisc => one_queue},
                mod_amp => #{},
                mod_disco =>
                  #{server_info => [],iqdisc => one_queue,
                  extra_domains => [],
                  users_can_see_hidden_services => false},
                mod_mam_rdbms_user => #{muc => true,pm => true},
                mod_mam_muc =>
                  #{host => {prefix,<<"muc.">>},
                  send_message => mod_mam_utils,
                  max_result_limit => 50,
                  async_writer =>
                    #{enabled => false,batch_size => 30,
                      flush_interval =>...

Report log


mysql_redis_26 / mysql_redis / 3c2dda5
Reports root/ big
OK: 4992 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.73%. Comparing base (1991bca) to head (6d25e6b).
Report is 29 commits behind head on feature/instrument.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           feature/instrument    #4297      +/-   ##
======================================================
- Coverage               84.76%   84.73%   -0.04%     
======================================================
  Files                     557      557              
  Lines                   33897    33908      +11     
======================================================
- Hits                    28734    28731       -3     
- Misses                   5163     5177      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gustawlippa gustawlippa marked this pull request as ready for review June 11, 2024 12:14
Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I only added minor nodes.

big_tests/tests/pubsub_SUITE.erl Outdated Show resolved Hide resolved
src/pubsub/mod_pubsub.erl Outdated Show resolved Hide resolved
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jun 12, 2024

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 47a8941
Reports root/ big
OK: 457 / Failed: 0 / User-skipped: 41 / Auto-skipped: 0


small_tests_25 / small_tests / 47a8941
Reports root / small


small_tests_26 / small_tests / 47a8941
Reports root / small


small_tests_26_arm64 / small_tests / 47a8941
Reports root / small


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 47a8941
Reports root/ big
OK: 4622 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 47a8941
Reports root/ big
OK: 2290 / Failed: 0 / User-skipped: 905 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 47a8941
Reports root/ big
OK: 2290 / Failed: 0 / User-skipped: 905 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 47a8941
Reports root/ big
OK: 4589 / Failed: 0 / User-skipped: 138 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 47a8941
Reports root/ big
OK: 4622 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 47a8941
Reports root/ big
OK: 4519 / Failed: 0 / User-skipped: 174 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 47a8941
Reports root/ big
OK: 2430 / Failed: 0 / User-skipped: 765 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 47a8941
Reports root/ big
OK: 4992 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 47a8941
Reports root/ big
OK: 4619 / Failed: 0 / User-skipped: 108 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 47a8941
Reports root/ big
OK: 5013 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 47a8941
Reports root/ big
OK: 5013 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 47a8941
Reports root/ big
OK: 5010 / Failed: 0 / User-skipped: 115 / Auto-skipped: 0

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I just added one comment.

src/pubsub/mod_pubsub.erl Outdated Show resolved Hide resolved
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jun 13, 2024

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 6d25e6b
Reports root/ big
OK: 457 / Failed: 0 / User-skipped: 41 / Auto-skipped: 0


small_tests_25 / small_tests / 6d25e6b
Reports root / small


small_tests_26 / small_tests / 6d25e6b
Reports root / small


small_tests_26_arm64 / small_tests / 6d25e6b
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 6d25e6b
Reports root/ big
OK: 2290 / Failed: 0 / User-skipped: 905 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 6d25e6b
Reports root/ big
OK: 4622 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 6d25e6b
Reports root/ big
OK: 4622 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 6d25e6b
Reports root/ big
OK: 2289 / Failed: 1 / User-skipped: 905 / Auto-skipped: 0

pubsub_SUITE:dag+basic:purge_all_items_test
{error,{{badmatch,false},
    [{pubsub_tools,check_response,2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,444}]},
     {pubsub_tools,receive_response,3,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,434}]},
     {pubsub_tools,receive_and_check_response,4,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,424}]},
     {pubsub_SUITE,'-purge_all_items_test/1-fun-0-',2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
            {line,647}]},
     {escalus_story,story,4,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,72}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1302}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1234}]}]}}

Report log


internal_mnesia_26 / internal_mnesia / 6d25e6b
Reports root/ big
OK: 2430 / Failed: 0 / User-skipped: 765 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 6d25e6b
Reports root/ big
OK: 4589 / Failed: 0 / User-skipped: 138 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 6d25e6b
Reports root/ big
OK: 4619 / Failed: 0 / User-skipped: 108 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 6d25e6b
Reports root/ big
OK: 4519 / Failed: 0 / User-skipped: 174 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 6d25e6b
Reports root/ big
OK: 4992 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 6d25e6b
Reports root/ big
OK: 5013 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 6d25e6b
Reports root/ big
OK: 5013 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 6d25e6b
Reports root/ big
OK: 5006 / Failed: 4 / User-skipped: 115 / Auto-skipped: 0

muc_SUITE:register:user_submits_registration_form_twice
{error,
  {thrown,
    {timeout,
      [{escalus_connection,receive_stanza,2,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
          {line,302}]},
       {muc_SUITE,'-user_submits_registration_form_twice/1-fun-0-',1,
         [{file,
            "/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
          {line,2800}]},
       {escalus_story,story,4,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
          {line,72}]},
       {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
       {test_server,run_test_case_eval1,6,
         [{file,"test_server.erl"},{line,1302}]},
       {test_server,run_test_case_eval,9,
         [{file,"test_server.erl"},{line,1234}]}]}}}

Report log

muc_SUITE:register:user_unregisters_nick_twice
{error,
  {thrown,
    {timeout,
      [{escalus_connection,receive_stanza,2,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
          {line,302}]},
       {muc_SUITE,'-user_unregisters_nick_twice/1-fun-0-',1,
         [{file,
            "/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
          {line,2831}]},
       {escalus_story,story,4,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
          {line,72}]},
       {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
       {test_server,run_test_case_eval1,6,
         [{file,"test_server.erl"},{line,1302}]},
       {test_server,run_test_case_eval,9,
         [{file,"test_server.erl"},{line,1234}]}]}}}

Report log

muc_SUITE:register:user_unregisters_nick
{error,
  {thrown,
    {timeout,
      [{escalus_connection,receive_stanza,2,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
          {line,302}]},
       {muc_SUITE,'-user_unregisters_nick/1-fun-0-',1,
         [{file,
            "/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
          {line,2821}]},
       {escalus_story,story,4,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
          {line,72}]},
       {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
       {test_server,run_test_case_eval1,6,
         [{file,"test_server.erl"},{line,1302}]},
       {test_server,run_test_case_eval,9,
         [{file,"test_server.erl"},{line,1234}]}]}}}

Report log

muc_SUITE:register:user_changes_nick
{error,
  {thrown,
    {timeout,
      [{escalus_connection,receive_stanza,2,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_connection.erl"},
          {line,302}]},
       {muc_SUITE,'-user_changes_nick/1-fun-0-',1,
         [{file,
            "/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
          {line,2814}]},
       {escalus_story,story,4,
         [{file,
            "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
          {line,72}]},
       {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
       {test_server,run_test_case_eval1,6,
         [{file,"test_server.erl"},{line,1302}]},
       {test_server,run_test_case_eval,9,
         [{file,"test_server.erl"},{line,1234}]}]}}}

Report log

muc_SUITE:register:end_per_group
{error,
  {{badrpc,
     {'EXIT',
       {timeout,
         {gen_server,call,
           ['wpool_pool-mongoose_wpool$rdbms$global$default-1',
            {sql_cmd,
              {sql_execute,auth_get_password,
                [<<"localhost">>,<<"alice">>]},
              -576459761814},
            60000]}}}},
   [{escalus_rpc,call_with_cookie_match,
      [mongooseim@localhost,ejabberd_admin,unregister,
       [<<"alicE">>,<<"localhost">>],
       30000,mongooseim],
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_rpc.erl"},
       {line,34}]},
    {lists,foreach_1,2,[{file,"lists.erl"},{line,1686}]},
    {escalus_ejabberd,delete_users,2,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_ejabberd.erl"},
       {line,216}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1390}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1234}]}]}}

Report log


ldap_mnesia_26 / ldap_mnesia / 6d25e6b
Reports root/ big
OK: 2290 / Failed: 0 / User-skipped: 905 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 6d25e6b
Reports root/ big
OK: 5010 / Failed: 0 / User-skipped: 115 / Auto-skipped: 0

Copy link
Contributor

@arcusfelis arcusfelis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok

@chrzaszcz chrzaszcz merged commit 984a8cc into feature/instrument Jun 13, 2024
4 checks passed
@chrzaszcz chrzaszcz deleted the instrument/pubsub branch June 13, 2024 08:35
@jacekwegr jacekwegr added this to the 6.3.0 milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants