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

Add a latest observations endpoint for the nodes #21

Open
2 tasks
vforgione opened this issue Dec 13, 2018 · 3 comments
Open
2 tasks

Add a latest observations endpoint for the nodes #21

vforgione opened this issue Dec 13, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@vforgione
Copy link
Member

This is a feature request. It would be helpful to have an endpoint that returns the latest observations for the nodes.

  • /nodes/latest to get the latest for all nodes
  • /nodes/:vsn/latest to get the latest for a specific node

In this sense, latest would be the latest observation by timestamp for the key {vsn, subsystem, sensor, param}. It may require creating a new table and setting up some triggers.

@vforgione vforgione self-assigned this Dec 13, 2018
@vforgione vforgione added the enhancement New feature or request label Dec 13, 2018
@vforgione
Copy link
Member Author

There are some changes underway on the design of the data for AoT (I'm part of the design and implementation), so for not it doesn't seem like this is a worthwhile endeavor. The data will change soonish and then I'll have to patch what I've done with this.

I will keep this use case in mind as we design up the next version of Beehive -- this is super useful for multiple use cases internal to AoT as well.

@laconical77
Copy link

Actually, as someone who is trying to make use of this AoT data, having a mechanism to read the latest observations would be absolutely fantastic.

I'm trying to set up a system which reads the latest observations for every node in Chicago every 5 minutes, regardless of how long ago the last reading came in. I don't need to see every single change that occurs on every single sensor - just the current snapshot of what is happening at that node. At the moment, I have no way of doing that.

Instead, every 5 minutes I'm sending a query for each node with a timestamp filter asking for the last 5 minutes of data. So I'm asking for far more data than I require because it's the closest method to getting the latest observations that I could come up with. And it isn't foolproof, because there are devices out there with sensors where the data doesn't change for long periods, so when my application starts up it can't guarantee that it has the latest value for each sensor param.

So yeah, +1 for /nodes/:vsn/latest, as it would be very helpful.

@vforgione
Copy link
Member Author

There is a new websocket available to push out the latest observations per node. Take a look at https://api-of-things.plenar.io/ws-demo .

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

2 participants