-
Notifications
You must be signed in to change notification settings - Fork 11k
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
chore: Improve groups.create
endpoint for large amounts of members
#30499
Conversation
|
Codecov Report
@@ Coverage Diff @@
## develop #30499 +/- ##
===========================================
- Coverage 50.87% 50.81% -0.06%
===========================================
Files 809 803 -6
Lines 15020 15014 -6
Branches 2729 2733 +4
===========================================
- Hits 7642 7630 -12
+ Misses 6969 6959 -10
- Partials 409 425 +16
Flags with carried forward coverage won't be shown. Click here to find out more. |
groups.create
endpoint for large amounts of members
…ove/ui-caching * 'develop' of github.com:RocketChat/Rocket.Chat: fix: Remove monitors query restrictions on update (#30550) chore: license v3 invalidation (#30585) chore: `CreateDirectMessage` a11y form improvements (#30581) chore: `CreateDiscussion` a11y improvements (#30583) chore: License v3 - behavior and limited reached triggers (#30561) chore: Improve `groups.create` endpoint for large amounts of members (#30499) feat: Monitors able to forward chats without joining (#30549) feat: Deployment Fingerprint (#30411) chore: fix flaky agents & custom fields tables tests (#30580)
…/mentionBot * 'develop' of github.com:RocketChat/Rocket.Chat: (68 commits) fix: don't save the filter value on offlineMessageChannelName (#30576) feat: New permission to kick users (#30535) chore: improve message link focus (#30578) chore: Add required visual indication on `EditRoom` name input (#30589) fix: user dropdown menu position on RTL layout (#30490) chore: add missing `_id` field to `AtLeast` (#30592) test: Improve tests for legacy omnichannel analytics (#30379) fix: Remove monitors query restrictions on update (#30550) chore: license v3 invalidation (#30585) chore: `CreateDirectMessage` a11y form improvements (#30581) chore: `CreateDiscussion` a11y improvements (#30583) chore: License v3 - behavior and limited reached triggers (#30561) chore: Improve `groups.create` endpoint for large amounts of members (#30499) feat: Monitors able to forward chats without joining (#30549) feat: Deployment Fingerprint (#30411) chore: fix flaky agents & custom fields tables tests (#30580) feat: Save visitor's activity on agent's interaction (#30222) chore: update mentions upsell modal content (#30503) fix: font-disabled color (#30569) chore: anchor text-decoration rules (#30485) ...
Proposed changes (including videos or screenshots)
Some key changes:
createRoom
function, to receive anIUser
instead of ausername
. This was to prevent multiple trips to DB being done to fetch data from the same userinsertMany
. Before they were being created synchronously one by one__rooms
property with a singleupdateMany
command instead of multipleupdateOne
for each user/member providedYou can see below a load test comparing the old and the new code.
This test was performed by calling the endpoint providing an array with 100 members during 2 minutes by 5 simultaneous virtual users:
This one was also provided an array with 100 members but during 5 minutes by 5 simultaneous virtual users. another difference is that the user calling the API was already a member of 70k+ rooms:
we can see in both cases an improvement of around 50% either in number of requests or response time.
I still plan to add some tests.. I noticed we don't have tests covering even common use cases.
Issue(s)
Steps to test or reproduce
Further comments