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

Document usage of time_bucket parameter #8

Open
chrisluedtke opened this issue May 17, 2019 · 4 comments
Open

Document usage of time_bucket parameter #8

chrisluedtke opened this issue May 17, 2019 · 4 comments

Comments

@chrisluedtke
Copy link

I'd love to use this parameter rather than pulling and normalizing/interpolating data on my end, but documentation does not make the usage clear.

@vforgione
Copy link
Member

Sorry about that. Like the other issue I'm really pressed for time.

Here's an example: https://api-of-things.plenar.io/api/observations?time_bucket=avg:6%20hours&sensor=metsense.htu21d.temperature&node=004

The pattern is time_bucket={function}:{interval} where function is a Postgres statistical function and interval is a Postgres interval value.

You're also going to need to limit to the sensor you want to aggregate, and it usually makes sense to also limit to a node or project (rather than all the nodes).

@vforgione
Copy link
Member

Correction to the above comment: the function value is one of min, max, avg or median. I reviewed the controller code and remembered that I had restricted it to those.

@vforgione
Copy link
Member

I update the docs a bit. If you want to be a superstar and take a look and let me know if that's sufficient I'd like to hear your thoughts -- in general. I really don't like Apiary as I find it really restrictive, and I'm not sure how to best document really involved stuff like this function.

@chrisluedtke
Copy link
Author

Yes, that clears it up. I'll be playing with this in the next day or two.

image

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

No branches or pull requests

2 participants