diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:52 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:30:52 -0800 |
commit | 8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (patch) | |
tree | 11425ea0b299d6fb89c6d3618a22d97d5bf68d0f /WebKitTools/iExploder/tools | |
parent | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (diff) | |
download | external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.zip external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.gz external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'WebKitTools/iExploder/tools')
-rwxr-xr-x | WebKitTools/iExploder/tools/lasthit.rb | 53 | ||||
-rwxr-xr-x | WebKitTools/iExploder/tools/osx_last_crash.rb | 48 | ||||
-rwxr-xr-x | WebKitTools/iExploder/tools/showtest.rb | 43 |
3 files changed, 144 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); + } +} + diff --git a/WebKitTools/iExploder/tools/osx_last_crash.rb b/WebKitTools/iExploder/tools/osx_last_crash.rb new file mode 100755 index 0000000..5b62c6d --- /dev/null +++ b/WebKitTools/iExploder/tools/osx_last_crash.rb @@ -0,0 +1,48 @@ +#!/usr/bin/ruby +# Gives you information about the most recent crash for each application +# that has crashed within the last 2 days + +$LogDir=ENV['HOME'] + '/Library/Logs/CrashReporter' +$Days=1 +$StackCount=5 + +files=`find #$LogDir -mtime -#$Days -type f | grep -v synergy` +files.each { |filename| + filename.chop! + record = 0 + date='' + stackTrace = [] + + File.open(filename).readlines.each { |line| + #puts line + + if line =~ /^Date.*(200.*)/ + date = $1 + end + + if line =~ /^Thread \d+ Crashed/ + record = 1 + # reset the stack trace + stackTrace = [] + end + + if record + stackTrace << line + record = record + 1 + + # stop recording after $StackCount lines + if record > ($StackCount + 2) + record = nil + end + end + } + + puts File.basename(filename) + " - " + date + puts "===================================================" + stackTrace.each { |line| + puts line + } + puts "" +} + + diff --git a/WebKitTools/iExploder/tools/showtest.rb b/WebKitTools/iExploder/tools/showtest.rb new file mode 100755 index 0000000..af6b101 --- /dev/null +++ b/WebKitTools/iExploder/tools/showtest.rb @@ -0,0 +1,43 @@ +#!/usr/bin/ruby +# showtest.rb - simple CLI interface to grab a testcase +##################### +# +# Copyright (c) 2006 Thomas Stromberg <thomas%stromberg.org> +# +# This software is provided 'as-is', without any express or implied warranty. +# In no event will the authors be held liable for any damages arising from the +# use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software in a +# product, an acknowledgment in the product documentation would be appreciated +# but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# +# 3. This notice may not be removed or altered from any source distribution. + +Dir.chdir('../htdocs') +require 'iexploder'; +require 'config'; + +### THE INTERACTION ################################## +ie = IExploder.new($HTML_MAX_TAGS, $HTML_MAX_ATTRS, $CSS_MAX_PROPS) +ie.readTagFiles() + +if ! ARGV[0] + puts "syntax: showtest.rb [test#] [subtest#]" + exit +end + +ie.test_num = ARGV[0].to_i +ie.subtest_num = ARGV[1].to_i || 0 +ie.lookup_mode = 1 +ie.setRandomSeed + +puts ie.buildPage() |