chore: new stats
Proposed changes (including videos or screenshots)
New stats for the cloud stats collector service
Issue(s)
Steps to test or reproduce
Further comments
https://rocketchat.atlassian.net/browse/CONN-312
⚠️ No Changeset found
Latest commit: 831c994030b024ce34e189a6c99514d0b431f127
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Looks like this PR is not ready to merge, because of the following issues:
- This PR is targeting the wrong base branch. It should target 7.1.0, but it targets 6.14.0
Please fix the issues and try again
If you have any trouble, please check the PR guidelines
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 58.42%. Comparing base (
2b8ac8a) to head (831c994). Report is 1 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #33013 +/- ##
========================================
Coverage 58.42% 58.42%
========================================
Files 2746 2746
Lines 66285 66285
Branches 15001 15001
========================================
Hits 38730 38730
Misses 24732 24732
Partials 2823 2823
| Flag | Coverage Δ | |
|---|---|---|
| unit | 74.61% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
@hugocostadev you can help testing that as well..
if you can provide some explain() results, running the new queries in database with like 1 million rooms and 500k users, it would be extremely helpful.. (explain docs)
maybe even use https://github.com/KevLehman/filler and expand it to rooms
@hugocostadev, there might be a cleaner way to handle the countLivechatRoomsByPriority function by removing the second group and simplifying the projection (see the example below). In this approach, you'll handle the responses (an array with priorityWeight names and their values) in the code, which will help avoid overloading the database when dealing with larger customers.
Edit: Also, just a thought — it could be worth testing a projection right after the match so we only pass the priorityWeight field along instead of the entire document. This might help optimize things a bit.
Updated aggregate query suggestion
const pipeline = [
{
$match: {
t: 'l',
},
},
{
$project: {
priorityWeight: 1,
},
},
{
$group: {
_id: '$priorityWeight',
count: { $sum: 1 },
},
},
];
Explains:
cc: @diegolmello @KevLehman
Are those acceptable times? (1M rooms and 500k users)
totalLivechatRoomsWithPriority
activeUsersWithCustomRoles
PR Preview Action v1.4.8
:---:
:rocket: Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-33013/
on branch gh-pages at 2024-10-16 14:08 UTC
This PR currently has a merge conflict. Please resolve this and then re-add the ['stat: ready to merge', 'automerge'] label.
the tag stat: ready to merge was applied incorrectly here, as the milestone was 7.1.0 it shouldn't be ready for merge