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

feat: Count daily and monthly peaks of concurrent connections #30573

Merged
merged 18 commits into from
Oct 16, 2023

Conversation

matheusbsilva137
Copy link
Member

@matheusbsilva137 matheusbsilva137 commented Oct 4, 2023

Proposed changes (including videos or screenshots)

  • Add the dailyPeakConnections statistic for monitoring the daily peak of concurrent connections in a workspace;
  • Add maxMonthlyPeakConnections statistic for monitoring the last 30 days peak of concurrent connections in a workspace;

Issue(s)

Steps to test or reproduce

  • A new set of statistics for the current date can be generated using the /statistics endpoint. The current amount of users connected to a workspace can be checked with the existing presence.getConnections endpoint (the value generated for the dailyPeakConnections statistic is the highest value that could be returned by this endpoint since the last time the statistics were saved via cronjob).

Further comments

NBJ-416

@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2023

🦋 Changeset detected

Latest commit: ae10d1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@rocket.chat/presence Minor
@rocket.chat/meteor Minor
@rocket.chat/presence-service Patch
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/api-client Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
rocketchat-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/models Patch
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/uikit-playground Patch
@rocket.chat/web-ui-registration Major
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #30573 (ae10d1c) into develop (169da3a) will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #30573      +/-   ##
===========================================
- Coverage    51.29%   51.15%   -0.15%     
===========================================
  Files          811      805       -6     
  Lines        15059    15074      +15     
  Branches      2751     2785      +34     
===========================================
- Hits          7725     7711      -14     
- Misses        6926     6929       +3     
- Partials       408      434      +26     
Flag Coverage Δ
e2e 48.46% <ø> (-0.11%) ⬇️
unit 64.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@matheusbsilva137 matheusbsilva137 marked this pull request as ready for review October 5, 2023 17:11
@matheusbsilva137 matheusbsilva137 requested review from a team as code owners October 5, 2023 17:11
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 6, 2023
@janainaCoelhoRocketchat
Copy link
Contributor

image
tested

@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Oct 13, 2023
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 13, 2023
@dionisio-bot dionisio-bot bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Oct 13, 2023
@sampaiodiego
Copy link
Member

I've made a few changes to the PR.. removed the previously created new endpoint in favor of adding the values to the statistics.. 👍

@dionisio-bot dionisio-bot bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Oct 13, 2023
@dionisio-bot dionisio-bot bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Oct 16, 2023
@rodrigok
Copy link
Member

We need to state clearly that this only works for single instance deployments since it does not sum the count of connections among instances.

@rodrigok rodrigok merged commit c38711b into develop Oct 16, 2023
43 checks passed
@rodrigok rodrigok deleted the new/monthly-peak-connections branch October 16, 2023 18:50
@sampaiodiego
Copy link
Member

We need to state clearly that this only works for single instance deployments since it does not sum the count of connections among instances.

@rodrigok this is not true.. it does count connections from all instances.. each instance store the concurrent connections to their record into the instances collection.. the Presence service then summarize them up..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad: team-collab stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants