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

add metric: type of config file #2918

Merged
merged 1 commit into from
Oct 26, 2020
Merged

add metric: type of config file #2918

merged 1 commit into from
Oct 26, 2020

Conversation

janciesla8818
Copy link
Contributor

This PR adds a metric to see what type of configuration file is being used. The aim is to determine the adoption of the new config file format.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 22, 2020

8673.6 / Erlang 23.0.3 / ldap_mnesia / 0b98ad8
Reports root/ big
OK: 1400 / Failed: 0 / User-skipped: 253 / Auto-skipped: 0


8673.9 / Erlang 22.3 / pgsql_mnesia / 0b98ad8
Reports root/ big / small
OK: 2774 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0

@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 22, 2020

8674.1 / Erlang 23.0.3 / small_tests / 5260e00
Reports root / small


8674.2 / Erlang 23.0.3 / internal_mnesia / 5260e00
Reports root/ big
OK: 1488 / Failed: 0 / User-skipped: 165 / Auto-skipped: 0


8674.3 / Erlang 23.0.3 / odbc_mssql_mnesia / 5260e00
Reports root/ big
OK: 2761 / Failed: 0 / User-skipped: 228 / Auto-skipped: 0


8674.4 / Erlang 23.0.3 / mysql_redis / 5260e00
Reports root/ big
OK: 2756 / Failed: 0 / User-skipped: 233 / Auto-skipped: 0


8674.5 / Erlang 23.0.3 / riak_mnesia / 5260e00
Reports root/ big
OK: 1622 / Failed: 0 / User-skipped: 177 / Auto-skipped: 0


8674.6 / Erlang 23.0.3 / ldap_mnesia / 5260e00
Reports root/ big
OK: 1400 / Failed: 0 / User-skipped: 253 / Auto-skipped: 0


8674.7 / Erlang 23.0.3 / elasticsearch_and_cassandra_mnesia / 5260e00
Reports root/ big
OK: 330 / Failed: 0 / User-skipped: 38 / Auto-skipped: 0


8674.9 / Erlang 22.3 / pgsql_mnesia / 5260e00
Reports root/ big / small
OK: 2774 / Failed: 1 / User-skipped: 215 / Auto-skipped: 0

mod_global_distrib_SUITE:cluster_restart:test_location_disconnect
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alicE_test_location_disconnect_70.604476@localhost/res1">>,
          escalus_tcp,<0.9356.2>,
          [{event_manager,<0.9352.2>},
           {server,<<"localhost">>},
           {username,<<"alicE_test_location_disconnect_70.604476">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.9352.2>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_test_location_disconnect_70.604476">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,<<"alicE_test_location_disconnect_70.604476">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,<<"alicE_test_location_disconnect_70.604476">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"32645200072fb112">>}]},
        5000],
       [{file,
          "/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {mod_global_distrib_SUITE,'-test_location_disconnect/1-fun-0-',2,
       [{file,
          "/home/travis/build/esl/MongooseIM/big_tests/tests/mod_global_distrib_SUITE.erl"},
        {line,621}]},
     {escalus_story,story,4,
       [{file,
        ...

Report log

@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #2918 into master will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2918      +/-   ##
==========================================
- Coverage   79.16%   79.13%   -0.03%     
==========================================
  Files         378      378              
  Lines       32798    32804       +6     
==========================================
- Hits        25965    25960       -5     
- Misses       6833     6844      +11     
Impacted Files Coverage Δ
src/ejabberd_config.erl 76.99% <ø> (ø)
...stem_metrics/mongoose_system_metrics_collector.erl 90.90% <66.66%> (-1.40%) ⬇️
src/mam/mod_mam_rdbms_prefs.erl 90.99% <0.00%> (-3.61%) ⬇️
src/rdbms/mongoose_rdbms.erl 65.71% <0.00%> (-1.91%) ⬇️
...bal_distrib/mod_global_distrib_hosts_refresher.erl 71.69% <0.00%> (-1.89%) ⬇️
src/cassandra/mongoose_cassandra_worker.erl 71.69% <0.00%> (-0.95%) ⬇️
src/mam/mod_mam_utils.erl 88.99% <0.00%> (-0.65%) ⬇️
src/mod_roster.erl 79.62% <0.00%> (-0.47%) ⬇️
src/ejabberd_sm.erl 75.30% <0.00%> (-0.31%) ⬇️
src/mod_muc_log.erl 77.29% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aae6a5d...b64df30. Read the comment docs.

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.

I have a few comments.

ConfigType = case filename:extension(ConfigPath) of
".toml" -> toml;
".cfg" -> cfg;
_ -> unknown_config_type
Copy link
Member

Choose a reason for hiding this comment

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

This is not reachable - mongoose_config_parser:parse_file is called before and it would crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I just wanted to be double cautious just in case. If you think line 225 is unnecessary, I'll have it removed.

Copy link
Member

@chrzaszcz chrzaszcz Oct 23, 2020

Choose a reason for hiding this comment

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

The case expression in mongoose_config_parser:parse_file has only two clauses and I think these two should be consistent as they are checking the same thing. Services are started after the config is parsed, so MongooseIM would (and should) crash before this line is executed. Reaching this line would mean a bug in the code.

Copy link
Member

Choose a reason for hiding this comment

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

I hoped we could remove that line, but it is minor, so I am proceeding with the merge.

@@ -313,6 +296,9 @@ xmpp_stanzas_counts_are_reported(Config) ->
mongoose_helper:wait_until(fun xmpp_messages_count_is_reported/0, true),
mongoose_helper:wait_until(fun xmpp_stanzas_counts_are_reported/0, true).

config_type_is_reported(_Config) ->
mongoose_helper:wait_until(fun config_type_is_reported/0, true).
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be good to check that the correct format is reported here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, we could add this check. Should we expect "toml" to be returned, or should we check the file format? If we were to check the file format I think I would use mongoose_system_metrics_collector:get_config_type/0. With such test we only test if the metric is reported, we don't check if it is collected correctly, as we get the information in the exact same way, which puts in question checking the format at all.

Copy link
Member

@chrzaszcz chrzaszcz Oct 23, 2020

Choose a reason for hiding this comment

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

Actually this is going to be a short-lived metric, I think that checking it manually for toml and cfg should be enough. The code can remain unchanged.

Copy link
Member

Choose a reason for hiding this comment

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

There was no answer here, so I tested it myself and it works correctly.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Oct 23, 2020

8676.1 / Erlang 23.0.3 / small_tests / 548f9f5
Reports root / small


8676.2 / Erlang 23.0.3 / internal_mnesia / 548f9f5
Reports root/ big
OK: 1494 / Failed: 0 / User-skipped: 165 / Auto-skipped: 0


8676.4 / Erlang 23.0.3 / mysql_redis / 548f9f5
Reports root/ big
OK: 2762 / Failed: 0 / User-skipped: 233 / Auto-skipped: 0


8676.3 / Erlang 23.0.3 / odbc_mssql_mnesia / 548f9f5
Reports root/ big
OK: 2767 / Failed: 0 / User-skipped: 228 / Auto-skipped: 0


8676.7 / Erlang 23.0.3 / elasticsearch_and_cassandra_mnesia / 548f9f5
Reports root/ big
OK: 330 / Failed: 0 / User-skipped: 38 / Auto-skipped: 0


8676.5 / Erlang 23.0.3 / riak_mnesia / 548f9f5
Reports root/ big
OK: 1628 / Failed: 0 / User-skipped: 177 / Auto-skipped: 0


8676.6 / Erlang 23.0.3 / ldap_mnesia / 548f9f5
Reports root/ big
OK: 1406 / Failed: 0 / User-skipped: 253 / Auto-skipped: 0


8676.9 / Erlang 22.3 / pgsql_mnesia / 548f9f5
Reports root/ big / small
OK: 2780 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0

@chrzaszcz chrzaszcz merged commit 4e87bb5 into master Oct 26, 2020
@chrzaszcz chrzaszcz deleted the config-metric branch October 26, 2020 08:26
@NelsonVides NelsonVides added this to the 4.0.1 milestone Nov 13, 2020
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.

4 participants