0

I am trying to create a time series application, where the client application continuously connects to the server to get the recent statistics and plot the graph from it. Like say for say for every 30 seconds it requests for the statistics for something and then gets the data and plot the results in a nice graph.

I don't want the graph to be discontinuous. I mean I want the graph to be constantly updating showing the time series statistics. Something like shifting to the left and displaying the new one from the right in the graph. What is the right approach for this.

I am not sure but should I fetch the data from the web server. I mean I was planning to use a web server which can provide the recent stats. I am not sure should I use http or use sockets to make a constant connection from the client and access stats. I was thinking to create a web server using node.js and the clients requesting for stats every 30 sec or so.

Can you guys suggest what could be the best architecture for this? Are there any library for plotting this time series data. I mean I can use some to plot a static graph. But I want this graph to be constantly updated showing the recent stats.

4

1 回答 1

1

我建议查看网络套接字,服务器可以按您想要的任何时间间隔推送新的/更新的数据。像socket.io甚至更低的 engine.io 这样的东西将是进行实时更新的好选择。

至于绘制数据,我个人使用d3.js来绘制数据,需要几分钟才能进入,但非常适合这种用例。

Square 有很多关于构建分析和统计仪表板和技术的重要信息。http://corner.squareup.com/2012/04/building-analytics.html

于 2012-10-29T21:24:13.983 回答