开发者

How does the Firefox website make its download stats page work?

开发者 https://www.devze.com 2022-12-31 13:03 出处:网络
On the Mozilla website, there’s a page showing (apparently) live download s开发者_StackOverflowtatistics for Firefox: http://www.mozilla.com/en-US/firefox/stats/

On the Mozilla website, there’s a page showing (apparently) live download s开发者_StackOverflowtatistics 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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消