summaryrefslogtreecommitdiffstats
path: root/WebKitTools/iExploder/tools/lasthit.rb
diff options
context:
space:
mode:
authorCary Clark <>2009-04-14 06:33:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-14 06:33:00 -0700
commit563af33bc48281d19dce701398dbb88cb54fd7ec (patch)
tree395b4502f029dea8b25b342d66dc06b5d8f99985 /WebKitTools/iExploder/tools/lasthit.rb
parent5cfedfef172691d0f4bcf2be5ca3cddd8c9a47f4 (diff)
downloadexternal_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.zip
external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.gz
external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.bz2
AI 146110: add missing files to webkit
brings it in sync with webkit svn cl 42046 Automated import of CL 146110
Diffstat (limited to 'WebKitTools/iExploder/tools/lasthit.rb')
-rwxr-xr-xWebKitTools/iExploder/tools/lasthit.rb53
1 files changed, 53 insertions, 0 deletions
diff --git a/WebKitTools/iExploder/tools/lasthit.rb b/WebKitTools/iExploder/tools/lasthit.rb
new file mode 100755
index 0000000..b569deb
--- /dev/null
+++ b/WebKitTools/iExploder/tools/lasthit.rb
@@ -0,0 +1,53 @@
+#!/usr/bin/ruby
+# lasthit, part of iExploder
+#
+# Shows statistics about recent agents that have tested with iExploder.
+# It takes all or part of an apache logfile via stdin, and outputs a list
+# of all the agents who tested within that section, what their last test
+# was, and how many tests they have done.
+
+# The usefulness is finding out where a browser crashed.
+
+
+hostHash = Hash.new
+
+if (ARGV[0])
+ file = File.open(ARGV[0])
+else
+ file = $stdin
+end
+
+file.readlines.each { |line|
+ if (line =~ /^(.*?) .*iexploder.*?test=(\d+).* HTTP.* \"(.*?)\"$/)
+ host = $1
+ testnum = $2
+ agent = $3
+ if (! hostHash[host])
+ hostHash[host] = Hash.new
+ end
+ if (! hostHash[host][agent])
+ hostHash[host][agent] = Hash.new
+ hostHash[host][agent]['total'] = 0
+ end
+
+ hostHash[host][agent]['last'] = testnum
+ if line =~ /subtest=(\d+)/
+ hostHash[host][agent]['subtest'] = $1
+ else
+ hostHash[host][agent]['subtest'] = ''
+ end
+ hostHash[host][agent]['total'] = hostHash[host][agent]['total'] + 1
+ end
+}
+
+printf("%14.14s | %8.8s | %3.3s | %8.8s | %s\n",
+ "IP", "Test", "SubTest", "Total", "Agent")
+puts "---------------------------------------------------------------------------"
+hostHash.each_key { |host|
+
+ hostHash[host].each_key { |agent|
+ printf("%14.14s | %8.8s | %3.3s | %8.8s | %s\n",
+ host, hostHash[host][agent]['last'], hostHash[host][agent]['subtest'], hostHash[host][agent]['total'], agent);
+ }
+}
+