openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Add Follow counts to /stats page

Open mekarpeles opened this issue 1 year ago • 2 comments

We want to add Follow stats to the /stats dashboard

The end goal will look something like: Screenshot 2024-05-16 at 9 52 34 AM

We can follow the example of #6839, updating

  • loanstats.py https://github.com/internetarchive/openlibrary/pull/6839/files#diff-70c9042e0c7928343b9e0a33d290ef9f116ac6da6089fea722776cce717558f3
  • templates/admin/index.html https://github.com/internetarchive/openlibrary/pull/6839/files#diff-04453c3f25ef287e6cb14cb657a7bcb92d052612cb6c953c62810cbcaf71d373

In order to get the total count of patrons who are following others, I believe we can adapt and use https://github.com/internetarchive/openlibrary/blob/master/openlibrary/core/follows.py#L129 to be able to limit per time range of a number of days, similar to https://github.com/internetarchive/openlibrary/blob/master/openlibrary/core/ratings.py#L27-L39

mekarpeles avatar May 16 '24 14:05 mekarpeles

Hi there! Can I work on this issue?

Spedi avatar May 17 '24 21:05 Spedi

Hi @Spedi, sure! Would be happy to support you on this issue.

mekarpeles avatar May 18 '24 14:05 mekarpeles