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

Implement new stats endpoint #745

Open
bkis opened this issue Feb 22, 2025 · 0 comments
Open

Implement new stats endpoint #745

bkis opened this issue Feb 22, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bkis
Copy link
Member

bkis commented Feb 22, 2025

  • path: /api/platform/stats
  • returns extended stats when request is made by admin (A) or user (U) as opposed to visitor (V)
  • response model in new module tekst/models/stats.py
  • things that could be in scope for the endpoint:
    • number of registered users (V)
    • number of users with an active session (A)
    • number of users that logged in within the last week (needs last_login field on user doc, exclude from read model!) (U)
    • number of users that logged in within the last month (see above) (U)
    • number of users that logged in within the last year (see above) (U)
    • current number of outdated user messages (A)
    • current number of outdated access tokens (A)
    • total number of requested PW resets (happens on auth hooks; needs a stats collection for counting or a "stats" object in the state collection – which should be renamed to platform... and could the IDs just be "state" and "stats"??) (A)
    • total number of logins (A)
    • total number of quick searches (V)
    • total number of advanced searches (V)
    • total number of sent emails (A)
    • list of texts – with:
      • number of resources
      • ...
    • ...

The data should be served something like this:

{
  "users": {
    "registered": 40,
    "activeSession": 2,
    "loggedInPastWeek": 5,
    "loggedInPastMonth": 25,
    "loggedInPastYear": 39
  },
  "texts": [
    {
      "title": "Foo",
      "resources": 18
    }
  ],
  "search": {
    "countQuick": 321,
    "coundAdvanced": 210
  },
  "system": {
    "pwResets": 12,
    "oodTokens": 2,
    "oodUserMsgs": 13
  }
}
@bkis bkis added the enhancement New feature or request label Feb 22, 2025
@bkis bkis added this to the VedaWeb 2.0 launch milestone Feb 22, 2025
@bkis bkis self-assigned this Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant