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

refactor daily population to use a fields param #409

Open
bepetersn opened this issue May 21, 2014 · 1 comment
Open

refactor daily population to use a fields param #409

bepetersn opened this issue May 21, 2014 · 1 comment

Comments

@bepetersn
Copy link
Member

courtesy of the mind of @eads:

Instead of having 50 or 100 or more fields on the daily population summary as we do presently, we ought to simply have a fields param. For instance the present field "males_booked_bk" becomes a call to this URI:

/dailypopulation?fields=males,bk,booked

This would make having an additional parameter, "in_jail" (see #280) much easier. It would further imply, or could imply, several things. For instance, it would allow us to lazily evaluate the daily population changes. But perhaps that would be bad for our summary, so we could do something like cache it.

Plenty of things would also be up in the air, like what happens if you hit this API without supplying fields. I also can't think of how best to implement this presently, but I do think it would make our API easier to work with, and thus would be worth working out. One disadvantage of this approach is that multiple calls to our API would have to be made to get the same amount of information.

Whatever we want to go with, it needs to be decided pretty urgently! @wilbertom, @nwinklareth, @derekeder, @fgregg, what do y'all think?

@nwinklareth
Copy link
Contributor

I see this as a nice to have. It is easy to program in Javascript using
pluck to extract the field you are interested in and the data
transmission costs are low.

Doing an incremental summary calculation for a few days takes about 4
seconds. Once made,all subsequent calls are immediate.

This can be added at any time.

On Tue, May 20, 2014 at 10:48 PM, Brian Everett Peterson <
[email protected]> wrote:

courtesy of the mind of @eads https://github.com/eads:

Instead of having 50 or 100 or more fields on the daily population summary
as we do presently, we ought to simply have a fields param. For instance
the present field "males_booked_bk" becomes:

/dailypopulation?fields=male,bk,booked

This would make having an additional parameter, "in_jail" (see #280#280)
much easier. It would further imply, or could imply, several things. For
instance, it would allow us to lazily evaluate the daily population
changes. But perhaps that would be bad, so we could do something like cache
it.

Whatever we want to go with, it needs to be decided pretty urgently!
@wilbertom https://github.com/wilbertom, @nwinklarethhttps://github.com/nwinklareth,
@derekeder https://github.com/derekeder, @fgregghttps://github.com/fgregg,
what do y'all think?


Reply to this email directly or view it on GitHubhttps://github.com//issues/409
.

Regards

Norbert

Norbert Winklareth

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

2 participants