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

MAM shaper touches #3641

Merged
merged 5 commits into from
Apr 27, 2022
Merged

MAM shaper touches #3641

merged 5 commits into from
Apr 27, 2022

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Apr 27, 2022

Storing names instead of recalculating list_to_atom again and again, also moving from dict to maps.

@codecov
Copy link

codecov bot commented Apr 27, 2022

Codecov Report

Merging #3641 (8433f2b) into master (c53ce7a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3641   +/-   ##
=======================================
  Coverage   81.02%   81.02%           
=======================================
  Files         427      427           
  Lines       31965    31968    +3     
=======================================
+ Hits        25899    25903    +4     
+ Misses       6066     6065    -1     
Impacted Files Coverage Δ
src/ejabberd_sup.erl 85.71% <ø> (ø)
src/mam/mod_mam_utils.erl 85.89% <100.00%> (-0.05%) ⬇️
src/mongoose_shaper_sup.erl 100.00% <100.00%> (ø)
src/shaper_srv.erl 81.81% <100.00%> (-2.80%) ⬇️
...bal_distrib/mod_global_distrib_hosts_refresher.erl 66.66% <0.00%> (-2.23%) ⬇️
src/logger/mongoose_log_filter.erl 78.08% <0.00%> (-1.37%) ⬇️
src/ejabberd_c2s.erl 88.42% <0.00%> (-0.23%) ⬇️
src/mod_muc_log.erl 63.21% <0.00%> (ø)
src/pubsub/mod_pubsub.erl 73.06% <0.00%> (+0.12%) ⬆️
src/domain/mongoose_domain_loader.erl 90.17% <0.00%> (+0.89%) ⬆️
... and 2 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 c53ce7a...8433f2b. Read the comment docs.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@NelsonVides NelsonVides changed the title Shaper names MAM shaper touches Apr 27, 2022
@NelsonVides NelsonVides marked this pull request as ready for review April 27, 2022 10:44
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.

use persistent terms.

  • some general info on shapers :)

src/shaper_srv.erl Outdated Show resolved Hide resolved
src/shaper_srv.erl Outdated Show resolved Hide resolved
src/shaper_srv.erl Outdated Show resolved Hide resolved
shapers = dict:new(),
a_times = dict:new()
shapers = #{},
a_times = #{}
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, we don't need to store a_times separately.
Shaper has last_update field in the state. Ok, technically it is last_update + delay, but should work as well.

We also don't need to store shaper at all, if their value is none (but we can try to create them each time we want to update them). Even more, we probably could just do mongoose_config:lookup_opt([shaper, Name]) before we call the shaper_srv and exit fast.

Also, the whole shaper logic could probably be moved to ETS, but that is another topic :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, these comments are out of the scope of this quick PR, I wasn't trying to build better shapers, but just rework generic code to make it faster, if you can reword these details and make it all better, that'd be awesome 🙏🏽

@mongoose-im
Copy link
Collaborator

mongoose-im commented Apr 27, 2022

small_tests_24 / small_tests / 8433f2b
Reports root / small


small_tests_23 / small_tests / 8433f2b
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 8433f2b
Reports root/ big
OK: 2860 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 8433f2b
Reports root/ big
OK: 2843 / Failed: 0 / User-skipped: 150 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 8433f2b
Reports root/ big
OK: 2860 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 8433f2b
Reports root/ big
OK: 2860 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 8433f2b
Reports root/ big
OK: 1506 / Failed: 0 / User-skipped: 401 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 8433f2b
Reports root/ big
OK: 1506 / Failed: 0 / User-skipped: 401 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 8433f2b
Reports root/ big
OK: 1547 / Failed: 0 / User-skipped: 360 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 8433f2b
Reports root/ big
OK: 3234 / Failed: 0 / User-skipped: 142 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 8433f2b
Reports root/ big
OK: 1854 / Failed: 0 / User-skipped: 368 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 8433f2b
Reports root/ big
OK: 3234 / Failed: 0 / User-skipped: 142 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 8433f2b
Reports root/ big
OK: 3229 / Failed: 0 / User-skipped: 147 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 8433f2b
Reports root/ big
OK: 3234 / Failed: 0 / User-skipped: 142 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 8433f2b
Reports root/ big
OK: 1697 / Failed: 0 / User-skipped: 367 / Auto-skipped: 0

@arcusfelis arcusfelis merged commit 7c573d4 into master Apr 27, 2022
@arcusfelis arcusfelis deleted the shaper_names branch April 27, 2022 14:39
@Premwoik Premwoik added this to the 5.1.0 milestone May 25, 2022
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