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

Expose an API to retrieve ALL users love counts over a time period #26

Open
danielpops opened this issue Mar 2, 2017 · 2 comments
Open

Comments

@danielpops
Copy link
Member

It would be great if the love service exposed an endpoint where you can get an aggregate count of ALL users send/received love counts over a time period. The query would be something conceptually like
SELECT user, COUNT(sent), COUNT(received) FROM table WHERE date >= @start AND date <= @end

@brenns10
Copy link
Contributor

brenns10 commented Mar 2, 2017

The ugly truth of Google Query Language is that typical aggregation functions like COUNT(), SUM(), MAX(), etc. are not even included. To do something as simple as the leaderboard, there has to be a separate table holding weekly love counts. So this operation would require us to iterate over every love sent in the time range and count them up. Which is probably feasible for a small enough time range, but could end up running long and potentially consuming lots of memory, which is a problem because GAE kills requests after 10 seconds, or if they exceed 128 MB of memory.

It's objectively a good idea for a feature, but those are some of the problems we might run into while implementing it.

@sjaensch
Copy link
Contributor

One thing I'd like for us to do eventually is move off of the old proprietary App Engine APIs. If we migrate to the flexible environment we could use a different datastore that has these capabilities. We could also move to Python 3.

That would be a pretty big task though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants