Skip to content

Commit

Permalink
Base pass rate on examples rather than expectations, don't weigh Iron…
Browse files Browse the repository at this point in the history
…Ruby's pass-rate against MRI, remove files and expectations from the RubySpec output, and don't run throughput/startup tests as they aren't used.
  • Loading branch information
unknown committed Jan 26, 2010
1 parent 3bcf15c commit eb029e3
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 50 deletions.
15 changes: 5 additions & 10 deletions app.rb
@@ -1,5 +1,7 @@
File.open(File.dirname(__FILE__) + '/data/pid1', 'w'){ |f| f.print Process.pid } File.open(File.dirname(__FILE__) + '/data/pid1', 'w'){ |f| f.print Process.pid }


$: << File.expand_path(File.dirname(__FILE__))

require 'rubygems' require 'rubygems'
require 'sinatra' require 'sinatra'
require 'haml' require 'haml'
Expand Down Expand Up @@ -45,15 +47,15 @@ def green_or_red(data, append = "")
end end


def total_pass_rate(comp, ref) def total_pass_rate(comp, ref)
((comp[:expectations].to_i - comp[:failures].to_i - comp[:errors].to_i).to_f / ref[:expectations].to_i).round_to(4) ((comp[:examples].to_i - comp[:failures].to_i - comp[:errors].to_i).to_f / comp[:examples].to_i).round_to(4)
end end


def grand_total_pass_rate(stats, comp = :ironruby) def grand_total_pass_rate(stats, comp = :ironruby)
totals = { totals = {
comp => {}, comp => {},
:ruby => {} :ruby => {}
} }
types = [:expectations, :failures, :errors] types = [:expectations, :failures, :errors, :examples]
specs = [:library, :core, :language] specs = [:library, :core, :language]


totals.each do |lang,_| totals.each do |lang,_|
Expand All @@ -80,17 +82,10 @@ def mb(bytes)


get '/' do get '/' do
stats = nil stats = nil
File.open(Dir['data/data-*.dat'].sort.last, "rb") do |f| File.open(Dir[File.dirname(__FILE__) + '/data/data-*.dat'].sort.last, "rb") do |f|
@modification_time = f.mtime @modification_time = f.mtime
stats = Marshal.load(f) stats = Marshal.load(f)
end end

# FIXME Offset the library ruby expection number by 2300, since
# we're not taking into account ruby_bug guards in our numbers,
# and that's how many expectations IronRuby runs more that MRI
stats[:mspec_library][:ruby][:expectations] += 2300
stats[:mspec_library][:delta][:expectations] += 2300

haml :index, :locals => {:stats => stats} haml :index, :locals => {:stats => stats}
end end


Expand Down
17 changes: 17 additions & 0 deletions init.bat
@@ -0,0 +1,17 @@
set REPO=c:\dev\vsl1s_irstats
call %REPO%\Merlin\Main\Scripts\Bat\Dev.bat
pushd %MERLIN_ROOT%
pushd ..
echo Cleaning repo
tf undo . /recursive /noprompt
tfpt uu /recursive .
tfpt treeclean . /noprompt /recursive
msbuild %MERLIN_ROOT%\Languages\Ruby\Ruby.sln /t:Clean
echo Getting latest sources
tf get
tf unshelve rubytags-2010-01-22;jimmysch /noprompt
popd
set GEM_HOME=%GEM_PATH%
set PATH=%MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p368\bin;%PATH%
set RUBY=%MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p368\bin\ruby.exe
%RUBY% -S gem install sinatra --no-ri --no-rdoc
13 changes: 4 additions & 9 deletions stats.bat
@@ -1,10 +1,5 @@
set REPO=c:\dev\vsl1s_irstats call %~dp0init.bat
call %REPO%\Merlin\Main\Scripts\Bat\Dev.bat echo Cleaning stats
pushd %MERLIN_ROOT%
tf get
tf unshelve rubytags-2010-01-22;jimmysch /noprompt
set GEM_HOME=%GEM_PATH%
set RUBY=%MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\Ruby\ruby-1.8.6p368\bin\ruby.exe
%RUBY% %~dp0stats.rb --clean %RUBY% %~dp0stats.rb --clean
%RUBY% %~dp0stats.rb --all echo Running stats
popd %RUBY% %~dp0stats.rb --all 1> %~dp0data\lastrun.log 2>&1
51 changes: 33 additions & 18 deletions stats.rb
Expand Up @@ -80,9 +80,9 @@ def mri(file, opts = nil)
end end


def build def build
print "Building IronRuby ... " print "Building IronRuby (release mode) ... "
result = Benchmark.measure do result = Benchmark.measure do
FileUtils.cd(RB) { system "msbuild Ruby.sln /p:Configuration=Release /v:m /nologo > #{DATA.to_dos}\\compile.log 2>&1" } FileUtils.cd(RB) { system "msbuild Ruby.sln /p:Configuration=Release /nologo > #{DATA.to_dos}\\compile.log 2>&1" }
end end
puts "done" puts "done"
result.real result.real
Expand All @@ -99,9 +99,17 @@ def working_set
working_set = 0 working_set = 0
begin begin
t = Thread.new{ system "#{IR.to_dos} #{to_dos "#{CD}/getpid.rb"}" } t = Thread.new{ system "#{IR.to_dos} #{to_dos "#{CD}/getpid.rb"}" }
puts "Letting IronRuby run for 5 seconds..." print "Running for 5 seconds to get working set "
sleep(5) count, done = 0, 4
puts "Getting working set" loop { sleep(1); print '.'; break if (count += 1) > done }
count, timeout = 0, 19
loop do
break if File.exist?("#{DATA}/pid")
raise "Timeout getting working set" if (count += 1) > timeout
sleep(1)
print '.'
end
puts ' found'
pid = File.open("#{DATA}/pid".to_dos, 'r'){|f| f.read }.to_i pid = File.open("#{DATA}/pid".to_dos, 'r'){|f| f.read }.to_i
processes = WIN32OLE.connect("winmgmts://").ExecQuery( processes = WIN32OLE.connect("winmgmts://").ExecQuery(
"select * from win32_process where ProcessId = #{pid}") "select * from win32_process where ProcessId = #{pid}")
Expand Down Expand Up @@ -272,13 +280,13 @@ def report_repo
github_size github_size
end end


def report_startup #def report_startup
startup_time # startup_time
end #end


def report_throughput #def report_throughput
throughput # throughput
end #end


def report_working_set def report_working_set
working_set working_set
Expand Down Expand Up @@ -360,13 +368,19 @@ def _kill(pidfile, t = nil)
end end


def _upload_html(filename, indexfile) def _upload_html(filename, indexfile)
print "Uploading ironruby.info homepage ... " print "Connecting to ironruby.info ... "
require 'net/ftp' require 'net/ftp'
ftp = Net::FTP.new("ironruby.com") ftp = Net::FTP.new("ironruby.com")
ftp.login('ironruby', _get_pswd) ftp.login('ironruby', _get_pswd)
ftp.passive = true
ftp.chdir('info') ftp.chdir('info')
puts 'done'
print "Uploading #{filename} to http://ironruby.info/#{File.basename(filename)} ... "
ftp.puttextfile filename ftp.puttextfile filename
puts 'done'
print "Uploading #{indexfile} to http://ironruby.info/#{File.basename(indexfile)} ... "
ftp.puttextfile indexfile ftp.puttextfile indexfile
puts 'done'
end end


def _get_pswd def _get_pswd
Expand Down Expand Up @@ -416,13 +430,13 @@ def report_repo
"Github repo size: #{mb(data)} MB\n" "Github repo size: #{mb(data)} MB\n"
end end


def report_startup #def report_startup
"Startup time: #{data.map{|k,v| "#{k}(#{v} s)"}.join(", ")}\n" # "Startup time: #{data.map{|k,v| "#{k}(#{v} s)"}.join(", ")}\n"
end #end


def report_throughput #def report_throughput
"Throughput: (100000 iterations): #{data.map{|k,v| "#{k}(#{v} s)"}.join(", ")}\n" # "Throughput: (100000 iterations): #{data.map{|k,v| "#{k}(#{v} s)"}.join(", ")}\n"
end #end


def report_working_set def report_working_set
"Working set: #{mb data} MB\n" "Working set: #{mb data} MB\n"
Expand Down Expand Up @@ -525,4 +539,5 @@ def usage
end end
end end


puts "SUCCESS!"
end end
Binary file removed views/.index.haml.swp
Binary file not shown.
Binary file removed views/.mspec.haml.swp
Binary file not shown.
13 changes: 0 additions & 13 deletions views/mspec.haml
Expand Up @@ -7,24 +7,11 @@
%td %td
No data No data
- else - else
%tr
%th files
%td{:colspan => 2}= data mspec[:ironruby][:files]
%td{:colspan => 1}= data mspec[:ruby][:files]
%td= green_or_red -1 * mspec[:delta][:files]
%tr %tr
%th examples %th examples
%td{:colspan => 2}= data mspec[:ironruby][:examples] %td{:colspan => 2}= data mspec[:ironruby][:examples]
%td{:colspan => 1}= data mspec[:ruby][:examples] %td{:colspan => 1}= data mspec[:ruby][:examples]
%td= green_or_red -1 * mspec[:delta][:examples] %td= green_or_red -1 * mspec[:delta][:examples]
%tr
%th expectations
%td{:colspan => 2}= data mspec[:ironruby][:expectations]
%td{:colspan => 1}
%span= data mspec[:ruby][:expectations]
- if title == "Library"
%a{:href => 'javascript:void(0)', :onclick => "alert('The Ruby exceptions number is inflated by 2300, because RubySpec does not run that number of tests on Ruby, but will run on IronRuby. This prevents the IronRuby pass-rate for libraries from looking inflated.')"} ?
%td= green_or_red -1 * mspec[:delta][:expectations]
%tr %tr
%th failures %th failures
%td{:colspan => 2}= mspec[:ironruby][:failures] %td{:colspan => 2}= mspec[:ironruby][:failures]
Expand Down

0 comments on commit eb029e3

Please sign in to comment.