Firefox 网站如何使其下载统计页面发挥作用?
在 Mozilla 网站上,有一个页面(显然)显示 Firefox 的实时下载统计信息: http ://www.mozilla.com/en-US/firefox/stats/
他们如何执行获取实时统计数据的请求?我在 Firebug 中看不到持续的连接。
这是如何运作的?
On the Mozilla website, there’s a page showing (apparently) live download statistics for Firefox: http://www.mozilla.com/en-US/firefox/stats/
How are they performing their request to get the live stats data? I can not see a constant connection in Firebug.
How is this working?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 firebug 的 Net 选项卡中的country_report.json 响应,您可以看到每个国家/地区的类似内容:
所以这些图表并不是每秒实时更新。相反,他们绘制最近的请求历史记录,每秒一个点,并定期请求一组新的数据进行绘制。
他们似乎使用了名为 SQLstream 的东西来收集这些数据。
Looking at the country_report.json response in the Net tab of firebug, you can see something like this for each country:
So those graphs are not being updated every second in real time. Instead, they are plotting a recent history of requests, one point per second, and periodically requesting a new set of data to plot.
It seems they use something called SQLstream on their end to gather that data.
好的,开始了。我不明白的问题在这里得到解答:
http://blog.mozilla.com/webdev/2009/08/18/download-stats-move-to-mozilla-com/
玩得开心:-)
OK, here goes. The question I don't understand is answered here:
http://blog.mozilla.com/webdev/2009/08/18/download-stats-move-to-mozilla-com/
have fun :-)