[NEW] Collect data for Monthly/Daily Active Users for a future dashboard#11525
[NEW] Collect data for Monthly/Daily Active Users for a future dashboard#11525sampaiodiego merged 39 commits intodevelopfrom
Conversation
|
Can we rename this packed to |
|
@engelgabriel, Okay! I'm adding some improvements to this implementation, so I'm going to rename the package to be more generic, as you just suggested. |
3268b2f to
9544f6b
Compare
…itor # Conflicts: # packages/rocketchat-statistics/server/index.js
sampaiodiego
left a comment
There was a problem hiding this comment.
I have found an issue that if an instance dies all their sessions will never receive a closedAt .. I'm wondering if that might break/distort aggregations
| export class SAUMonitorClass { | ||
| constructor() { | ||
| this._serviceName = 'SAUMonitor'; | ||
| this._started = false; |
There was a problem hiding this comment.
any reason to have this started state? I haven't found anything stopping it. and from what I saw there is nothing trying to start it multiple times as well.
There was a problem hiding this comment.
This is just a precaution I guess
New
Server Session Monitorfor SAU (Simultaneously Active Users), which will provide important informations for DAU (Active Daily Users) and MAU (Monthly Active Users).The monitor is based on
Meteor server sessionsand will store the data in a new collection:rocketchat_sessions.The approach of this implementation will deal with
Connectionevents, such asonConnectionandonClose, as well as dealing withAccountevents, such asonLoginandonLogout.The SAU monitor will use the
Meteor server sessionsto update the session activities in DB. The monitor willpingthe active sessions every minute, updating thelastActivityAtfield on session documents.The session lifecycle is stored per day, so when the server date is changed, the current sessions will be created on the new day. This behaviour is designed to facilitate the collector process, which will aggregate the session life cycle and store it in another collection of statistics.
The regular(non-mobile) session documents will look like the doc below:
The mobile session documents will look like the doc below:
This new feature is being implemented in 3 steps:
This PR will close the issue number: #11461.
Once the implementation is approved, we need to think about the creation of a
cron jobthat will collect the data every day, aggregating the data and storing in two other collections: SAU and MAU.