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

stats: some circulation stats are incorrect because they also count notifications #3435

Closed
PascalRepond opened this issue Aug 22, 2023 · 0 comments
Labels
bug (critical) Blocking issue, should be fixed ASAP client request Issue reported by production libraries f: statistics Related to the usage statistics either for pricing or for the libaries reports

Comments

@PascalRepond
Copy link
Contributor

Bug description:

Billing and librarian stats that use the OperationLogs index now sometimes also count operation logs of type "notif" when they shouldn't.

For example:

        return RecordsSearch(index=LoanOperationLog.index_name)\
            .filter('range', date=self.date_range)\
            .filter('term', loan__trigger=trigger)\
            .filter('term', loan__item__library_pid=library_pid)\
            .count()

This filter OperationLogs by loan.trigger to count circulation actions but since the loan data is now dumped into the notification operation log, they are also counted.

We need to find all of these RecordsSearch(index=LoanOperationLog and check that they count what they are supposed to count. Most likely add a filter type="loan" when we want to count circulation operations and not notifs.

Expected behavior:

Notifications operation logs are not wrongfully counted when generating stats .

Context

Server:

Version:

v1.18.0

@PascalRepond PascalRepond added bug (critical) Blocking issue, should be fixed ASAP f: statistics Related to the usage statistics either for pricing or for the libaries reports client request Issue reported by production libraries labels Aug 22, 2023
@PascalRepond PascalRepond moved this from Inbox to Product Backlog in RERO ILS issues Aug 22, 2023
@PascalRepond PascalRepond moved this from Product Backlog to Sprint backlog in RERO ILS issues Aug 22, 2023
PascalRepond added a commit to PascalRepond/rero-ils that referenced this issue Aug 31, 2023
* Closes rero#3435.
* Cleans up some functions and params.
* Fix incorrect and unclear docstrings.
* ⚠️ Incorrectly generated stats will need to be regenerated.

Co-authored-by: Pascal Repond <pascal.repond@rero.ch>
PascalRepond added a commit to PascalRepond/rero-ils that referenced this issue Aug 31, 2023
* Closes rero#3435.
* Cleans up some functions and params.
* Fix incorrect and unclear docstrings.
* ⚠️ Incorrectly generated stats will need to be regenerated.

Co-authored-by: Pascal Repond <pascal.repond@rero.ch>
@PascalRepond PascalRepond moved this from Sprint backlog to In Development in RERO ILS issues Sep 4, 2023
jma added a commit to jma/rero-ils that referenced this issue Sep 25, 2023
* Splits the classes to compute statistics into several files.
* Fixes some spelling.
* Renames abstract class which is not abstract.
* Removes useless parameters in the statics methods.
* Get the location names using only one es query.
* Creates a loan search query used for several statistics.
* Fixes delete items statistics.
* Adds tests for statistics.
* Fixes some test fixtures.
* Adds a type filter to the operation logs search to avoid unwanted documents.
* Closes: rero#3435.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
@jma jma closed this as completed in 99bdf77 Sep 25, 2023
@github-project-automation github-project-automation bot moved this from In Development to Done in RERO ILS issues Sep 25, 2023
Garfield-fr added a commit that referenced this issue Sep 25, 2023
* Splits the classes to compute statistics into several files.
* Fixes some spelling.
* Renames abstract class which is not abstract.
* Removes useless parameters in the statics methods.
* Get the location names using only one es query.
* Creates a loan search query used for several statistics.
* Fixes delete items statistics.
* Adds tests for statistics.
* Fixes some test fixtures.
* Adds a type filter to the operation logs search to avoid unwanted documents.
* Closes: #3435.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (critical) Blocking issue, should be fixed ASAP client request Issue reported by production libraries f: statistics Related to the usage statistics either for pricing or for the libaries reports
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant