Skip to content

Instantly share code, notes, and snippets.

@ConradIrwin
Last active January 2, 2016 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ConradIrwin/8344018 to your computer and use it in GitHub Desktop.
Save ConradIrwin/8344018 to your computer and use it in GitHub Desktop.
Top 100 browsers that loaded bugsnag-js on the 8th of January 2014 UTC.

This is a breakdown of the top 100 browsers that bugsnag-js saw during 2014-01-08Z.

It's interesting to see that, for our customers at least, Safari (28%) beats Chrome (26%) by a small margin (maybe it's counting iPhone too); with IE (20%) slightly behind. Firefox (12%) is lagging sorely.

Raw percentages for the most popular 100 browsers (about 95% of total), the remainder were a total mess.

(Script is below to generate these numbers for yourself from cloudfront)

Chrome 31.0	19.35
Safari 7.0	16.71
Firefox 26.0	8.91
IE 11.0	6.74
Android 4.0	6.33
IE 8.0	5.68
Safari 6.1	4.72
IE 9.0	4.02
Chrome 32.0	3.73
IE 10.0	3.26
Safari 5.1	2.5
Safari 6.0	1.99
Mozilla 5.0	1.52
Safari ?	1.11
IE 7.0	1.0
Chrome 28.0	0.71
Safari 5.0	0.68
Chrome 18.0	0.52
Firefox 25.0	0.45
Firefox 3.6	0.44
Chrome 30.0	0.37
Chrome 29.0	0.32
Firefox 24.0	0.27
Chrome 21.0	0.22
Firefox 27.0	0.21
Chrome 27.0	0.17
Opera 7.5	0.16
BlackBerry 7.1	0.16
Chrome 26.0	0.15
Opera 12.16	0.15
Firefox 16.0	0.14
Safari 4.3	0.14
IE 6.0	0.13
Firefox 23.0	0.13
Firefox 22.0	0.12
Firefox 17.0	0.12
Firefox 12.0	0.11
Mozilla 4.0	0.1
Chrome 33.0	0.1
Chrome 11.0	0.09
Firefox 21.0	0.09
Firefox 20.0	0.08
Safari 4.1	0.08
Firefox 15.0	0.07
Firefox 11.0	0.07
BlackBerry 6.0	0.07
Firefox 19.0	0.07
Firefox 10.0	0.07
RED 1	0.06
iPhone ? 	0.06
Firefox 18.0	0.06
Firefox 14.0	0.06
Chrome 25.0	0.06
Safari 4.2	0.04
Firefox 13.0	0.04
Chrome 34.0	0.04
Chrome 23.0	0.04
Android 4.2	0.03
Safari 4.0	0.03
Safari 3.2	0.03
Chrome 24.0	0.03
Chrome 22.0	0.03
Opera 6.5	0.03
BlackBerry 10.2	0.03
Firefox 5.0	0.02
Opera 7.0	0.02
Opera 4.1	0.02
PB0.6b ?	0.02
Opera 7.1	0.02
Chrome 20.0	0.02
BlackBerry 10.1	0.02
Firefox 9.0	0.02
Firefox 7.0	0.02
Firefox 3.0	0.02
BlackBerry 7.0	0.02
Android 4.1	0.02
Firefox 6.0	0.02
Firefox 4.0	0.02
Firefox 3.5	0.02
Chrome 17.0	0.02
Firefox 8.0	0.02
Firefox 29.0	0.02
Chrome 12.0	0.02
Opera 4.2	0.01
Chrome 16.0	0.01
Chrome 14.0	0.01
Chrome 13.0	0.01
Safari 7.2	0.01
Opera 12.10	0.01
Chrome 15.0	0.01
Chrome 10.0	0.01
Safari 1.0	0.01
Chrome 19.0	0.01
Chrome 5.0	0.01
BlackBerry 10.0	0.01
Firefox 28.0	0.01
Opera 12.15	0.01
Firefox 1.5	0.01
Opera 12.00	0.01
Chrome 8.0	0.01
Chrome 6.0	0.01
# 1. Get a list of the logfiles you want to analyze:
# $ s3cmd ls s3://examplelogs/cf-logs/ABCDEF1234567890.2014-01-08 | sed 's/.*s3/s3/' | tee /tmp/logfiles
#
# 2. Extract the CGI-escaped user-agent strings:
# $ cat /tmp/logfiles | xargs -I{} s3cmd get {} - | gunzip | cut -d $'\t' -f 11 | tee /tmp/browsers
#
# 3. Parse them and add them up (requires gem install useragent)
# $ ruby analyze.rb <(cat /tmp/browsers | sort | uniq -c) | tee /tmp/analysis
#
require 'useragent'
require 'cgi'
require 'timeout'
require 'pry'
counts = Hash.new{ 0 }
ARGF.each_line.each_with_index do |line, i|
count, string = line.strip.split(" ")
next if string.start_with? "#"
$stderr.print "." if i % 10 == 0
begin
user_agent = UserAgent.parse(CGI.unescape(CGI.unescape(string)))
version = user_agent.version.to_s[/([^.]*\.[^.]*)/] || user_agent.version.to_s
str = [user_agent.browser, version].join(" ")
counts[str] += count.to_i
rescue => e
$stderr.puts e
$stderr.puts line.inspect
end
end
counts.sort_by{ |k, v|
v
}.each{ |(k,v)|
puts [k, v].join("\t")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment