Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Separated Room Statistics #5847

Closed
wants to merge 30 commits into from
Closed

Conversation

reivilibre
Copy link
Contributor

@reivilibre reivilibre commented Aug 13, 2019

This PR blocks:

  • More efficient room directory queries

Not included in this PR:

  • Purging of expired historical stats (i.e. the retention period is currently ignored)
  • FIXME: we could/should get this from room_stats when matthew/stats lands (handlers/sync.py)

To consider:

  • we may want to track current statistics and treat as zero-retention, if stats are disabled but the room directory is enabled – the room directory will depend on stats. This can be dealt with later, though, I suspect.
  • it occurs to me now that the current way that old collection is performed could lead to CPU + DB I/O bursts at the end of each day (with bucket_size=1 day), because all dirty rows will become old at the same time.
    • As such, old collection should only be ran on a 'few' (~250?) rows at once.
    • How about: 250 rows, definitely including the one we want to update will be old collected when we go to add delta for a stats row which is old. This still ensures we pick up extra rows, but without having to do absolutely all of them at once.
      • In the future, a background job could be added to run to perform old collection slowly to hoover up the missing ones.

I still need to add a changelog and some documentation.

  • Pull request is based on the develop branch
  • Pull request includes a changelog file
  • Pull request includes a sign off

Separated by current/historical

Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Still want to add more, concerning behaviour in the different states
of the background updater completion.

Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
unergonomic if we move to `async` from the bottom-up.

Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
rooms – varies depending upon room publicness.

Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
@codecov
Copy link

codecov bot commented Aug 14, 2019

Codecov Report

Merging #5847 into develop will increase coverage by 0.16%.
The diff coverage is 86.08%.

@@             Coverage Diff             @@
##           develop    #5847      +/-   ##
===========================================
+ Coverage    63.41%   63.58%   +0.16%     
===========================================
  Files          333      332       -1     
  Lines        36651    36494     -157     
  Branches      6057     6025      -32     
===========================================
- Hits         23244    23203      -41     
+ Misses       11755    11645     -110     
+ Partials      1652     1646       -6

@matrix-org matrix-org deleted a comment from codecov bot Aug 14, 2019
@reivilibre reivilibre marked this pull request as ready for review August 14, 2019 12:13
@reivilibre reivilibre requested a review from a team August 14, 2019 12:13
@@ -0,0 +1,2 @@
Rework room and user statistics to separate current & historical rows, as well
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one line for this please, btw

@reivilibre
Copy link
Contributor Author

Obsoleted by 8 other PRs.

@reivilibre reivilibre closed this Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants