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

Inbox/extend messages #3910

Merged
merged 2 commits into from
Jan 2, 2023
Merged

Inbox/extend messages #3910

merged 2 commits into from
Jan 2, 2023

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Dec 29, 2022

It happens that handler to extend inbox entries want to fetch extra data for each entry, so if the
hook is ran per message, the handler will have to make an extra query for each message, potentially
incurring into way too many round trips to the DB. Instead, we can pass the whole buffer to the
handler, so that the handler is able to aggregate as best as possible all the entries.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 29, 2022

small_tests_25 / small_tests / f354ada
Reports root / small


small_tests_24 / small_tests / f354ada
Reports root / small

It happens that handler to extend inbox entries want to fetch extra data for each entry, so if the
hook is ran per message, the handler will have to make an extra query for each message, potentially
incurring into way too many round trips to the DB. Instead, we can pass the whole buffer to the
handler, so that the handler is able to aggregate as best as possible all the entries.
@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

Base: 83.14% // Head: 83.15% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (f6b16c8) compared to base (1e2b382).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3910   +/-   ##
=======================================
  Coverage   83.14%   83.15%           
=======================================
  Files         535      535           
  Lines       34112    34110    -2     
=======================================
- Hits        28364    28363    -1     
+ Misses       5748     5747    -1     
Impacted Files Coverage Δ
src/inbox/mod_inbox_rdbms.erl 92.34% <ø> (ø)
src/inbox/mod_inbox.erl 87.38% <100.00%> (-0.06%) ⬇️
src/inbox/mod_inbox_entries.erl 97.40% <100.00%> (-0.25%) ⬇️
src/inbox/mod_inbox_utils.erl 96.80% <100.00%> (+0.25%) ⬆️
src/mongoose_hooks.erl 95.43% <100.00%> (ø)
src/domain/service_domain_db.erl 83.33% <0.00%> (-2.09%) ⬇️
src/rdbms/mongoose_rdbms.erl 66.31% <0.00%> (-0.71%) ⬇️
src/mod_muc_room.erl 78.68% <0.00%> (-0.06%) ⬇️
src/mod_muc_log.erl 62.82% <0.00%> (ø)
src/mod_muc.erl 74.47% <0.00%> (+0.23%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 29, 2022

small_tests_24 / small_tests / f6b16c8
Reports root / small


small_tests_25 / small_tests / f6b16c8
Reports root / small


ldap_mnesia_24 / ldap_mnesia / f6b16c8
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / f6b16c8
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / f6b16c8
Reports root/ big
OK: 4151 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / f6b16c8
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / f6b16c8
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / f6b16c8
Reports root/ big
OK: 2365 / Failed: 0 / User-skipped: 681 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / f6b16c8
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / f6b16c8
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / f6b16c8
Reports root/ big
OK: 2723 / Failed: 0 / User-skipped: 662 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / f6b16c8
Reports root/ big
OK: 2561 / Failed: 0 / User-skipped: 654 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / f6b16c8
Reports root/ big
OK: 4537 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / f6b16c8
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / f6b16c8
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0

@NelsonVides NelsonVides marked this pull request as ready for review December 29, 2022 12:41
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 👍

@chrzaszcz chrzaszcz merged commit 5523359 into master Jan 2, 2023
@chrzaszcz chrzaszcz deleted the inbox/extend_messages branch January 2, 2023 09:00
@jacekwegr jacekwegr added this to the 6.1.0 milestone Apr 26, 2023
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