Firefox 网站如何使其下载统计页面发挥作用?

发布于 2024-09-02 00:21:40 字数 245 浏览 2 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

短暂陪伴 2024-09-09 00:21:40

查看 firebug 的 Net 选项卡中的country_report.json 响应,您可以看到每个国家/地区的类似内容:

{"总计":95843579,"rps":[5,6,6,7,4,9,12,9,3,10,6,8,8,7,5,10,8,4 ,12,8,10,10,7,4,9,13,9,4,9,13,7,7,6,18,10,7,9,5,3,6,5,11,9 ,5,6,9,7,2,8,9,11,5,10,7,5,6,11,7,7,2],"count":455,"name":"美国" ,“代码”:“美国”}

所以这些图表并不是每秒实时更新。相反,他们绘制最近的请求历史记录,每秒一个点,并定期请求一组新的数据进行绘制。

他们似乎使用了名为 SQLstream 的东西来收集这些数据。

Looking at the country_report.json response in the Net tab of firebug, you can see something like this for each country:

{"total":95843579,"rps":[5,6,6,7,4,9,12,9,3,10,6,8,8,7,5,10,8,4,12,8,10,10,7,4,9,13,9,4,9,13,7,7,6,18,10,7,9,5,3,6,5,11,9,5,6,9,7,2,8,9,11,5,10,7,5,6,11,7,7,2],"count":455,"name":"United States","code":"US"}

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.

爱你是孤单的心事 2024-09-09 00:21:40

好的,开始了。我不明白的问题在这里得到解答:

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 :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文