atlastrafficmonitor / atlas-traffic-client

0 stars 2 forks source link

Data storage #4

Open thefyk opened 9 years ago

thefyk commented 9 years ago

How should we expect the data interface to be structured? Does each record/object represent a period of time with the count as an attribute? some other way?

Thanks,

ianks commented 9 years ago

We haven't fully decided on that. We could easily keep running tallies on the data and include them in the web-socket message. Something like:

{
  "totalEntries" : 42,
  "secondsSinceLastEntry" : 1.25,
  "timestamp" : 543265435,
  "swarm" : true
}

We just need to figure out what some useful measures would be. Also, the calculations should be fairly simply and we shouldn't introduce to much computational complexity so things will be speedy.

thefyk commented 9 years ago

For the visualization we're hoping to show information about the past hour and the hour before and maybe potentially forecast the future. I think all we'd need are the timestamp and totalentry for that portion at least unless there's other stuff you guys want too. but if its websockets does that mean that the message comes in real time? or can we query older values as well from the front-end?

ianks commented 9 years ago

It's in real time, however we could also set up a database query older values as well if that was desired.

BrianNewsom commented 9 years ago

I like the ideas, especially using a swarm tag or something. We could also have some form of confidence as well. { "timestamp" : 20 "confidence" : .4 }

It seems to me like everything else could be computed based on the previous events.

A database would be nice but doesn't seem totally necessary. It might also be good to just drop everything and reset all information every few hours or some set time interval so error doesn't propagate too far.

ianks commented 9 years ago

Yeah I agree with you on the database Brian. The only real benefit the database gives us in the ability to retroactively see what the traffic was. However, I tend to think on the fly updates are more interesting in the context of an installation.

For example, imagine having a live plotting of traffic on a graph. If you have tons of data from the previous days, then one persons movement wont make too much of a difference on the graph. However, if the graph just started, you could easily see the effect on the graph.

Doing the data aggregation client-side is my vote!