Open eecavanna opened 4 months ago
Here's the SQL query we submit to the Postgres database in order to get the number of user accounts that exist:
SELECT count(*)
FROM (
SELECT DISTINCT(orcid)
FROM user_logins
) as distinct_orcids;
-- Note: That happens to produce the same result as...
-- SELECT count(*)
-- FROM user_logins;
Tasks
/api/stats
endpoint. Some of the queries might take too long to run in "real time" like that. As an alternative, some of the queries could be run on a schedule and their results could be stored in the database, so that the API endpoint can serve them without actually performing the full query at that time (it would just fetch the pre-baked result of that full query)./api/stats
endpoint; or create a private counterpart to the endpoint (e.g./api/admin-stats
) that returns that additional data.Note: The assessment (second task) may result in us deciding not to pursue the implementation (third task).
Current behavior
For reference, here's what the
/api/stats
endpoint returns today: