-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 read stats in addition to borrows #10349
Conversation
Historically, we've only counted borrowing stats and not access to open materials.
@@ -158,6 +158,7 @@ def POST(self, key): # noqa: PLR0915 | |||
response = lending.get_availability_of_ocaid(edition.ocaid) | |||
availability = response[edition.ocaid] if response else {} | |||
if availability and availability['status'] == 'open': | |||
stats.increment('ol.reads.bookreader') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stats.increment('ol.reads.bookreader') | |
if not is_bot(): | |
stats.increment('ol.reads.bookreader') |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Let's just make sure it doesn't break on testing and does record some stat on graphite [for read option and not other options like borrow] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We looked on ABC call; seems low risk. @scottbarnes notes we couldn't quite test this on testing since statsd calls are seemingly disabled there.
Historically, we've only counted borrowing stats and not access to open materials.
One line improvement to track how often open access materials are read from Open Library.