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

Add usage related stuff + fix popularity related stuff #35

Merged
merged 6 commits into from
Nov 24, 2023
Merged

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented Nov 10, 2023

Rationale

Fix #32
#33 is almost fixed but there is still an open question in the issue which needs to be tackled before closing
Fix #34

NOTA: some changes most probably broke the UI (changes in KPI 2001 and 2002 data structures), but since the UI will be completely revamped anyway, I do not lost my time fixing this for now, we can live with this until I restart working on the UI.

Changes

  • create a new UsageRecorder to count active slots of 10 minutes during which an input has been received
  • create a new CommonInputGenerator for cases not already covered by existing generators (apps which are not edupi)
  • renaming of inputs / indicators / kpis related to KPI 2001 and 2002 (including modules names)
  • create a new PackageRequest input to indicate that web traffic has been received on a given package and generate this input on all generators, in addition to existing inputs
  • make all input classes frozen and eq, so that we can compare them more easily (and they must be frozen anyway)
  • create new TotalUsage KPI for 2003
  • update list of existing indicators and KPIs in the processor (this was missing from previous PR)

@benoit74 benoit74 self-assigned this Nov 10, 2023
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d2911f7) 98.18% compared to head (89a09b4) 98.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   98.18%   98.35%   +0.16%     
==========================================
  Files          30       34       +4     
  Lines         936     1031      +95     
  Branches      181      195      +14     
==========================================
+ Hits          919     1014      +95     
  Misses         12       12              
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74 benoit74 force-pushed the add_last_kpis branch 2 times, most recently from 40bfd62 to 1b2327b Compare November 10, 2023 09:44
@benoit74 benoit74 marked this pull request as ready for review November 10, 2023 09:50
@benoit74 benoit74 requested a review from rgaudin November 10, 2023 09:50
@benoit74
Copy link
Collaborator Author

@rgaudin did you already start reviewing this PR or may I push a new commit? (almost negligible change, but still something you might have already spotted / might confuse you)

@rgaudin
Copy link
Member

rgaudin commented Nov 16, 2023

Haven't started ; please do

@benoit74
Copy link
Collaborator Author

Ready again for review

Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

Thank you!
Wise renaming while it's still doable 😄

What's the storage impact of this new generic PackageRequest?

@benoit74
Copy link
Collaborator Author

What's the storage impact of this new generic PackageRequest?

Inputs are not stored, so there is 0 impact on storage. There is a computing impact since these inputs will have to be processed, but since most indicators do not process this kind of inputs (only TotalUsageOverall and TotalUsageByPackage does), I expect that impact will be limited. Most indicators will just say "I don't mind about this kind of input, next!". And I hope that TotalUsage indicators will not consume much resources (but this has to be confirmed in perf tests).

@benoit74 benoit74 requested a review from rgaudin November 24, 2023 08:31
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

Thank you ; those comments are really helpful

@rgaudin rgaudin merged commit 7c64038 into main Nov 24, 2023
6 checks passed
@rgaudin rgaudin deleted the add_last_kpis branch November 24, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend: implement TotalUsage KPI Backend: Implement PackagePopularity KPI
2 participants