com pftt2: improvements to reports: PFTT/lib/report/comparison.rb PFTT/lib/report/comparison/by_platform/func_build_compari son.rb
PFTT/lib/report/comparison/by_platform/perf_buil d_comparison.rb PFTT/lib/report/run/by_host/by_build/ by_middleware/func.rb
PFTT/lib/report/run/by_host/by_ build/func.rb PFTT/lib/report/run/per_host/per_build/pe r_middleware/func.rb PFTT/lib/report/triage.rb PFTT/s
cripts/SDK4Win/PFTT PFTT/scripts/SDK4Win/PHP PFTT/scrip ts/

From: Date: Mon, 24 Oct 2011 04:29:38 +0000
Subject: com pftt2: improvements to reports: PFTT/lib/report/comparison.rb PFTT/lib/report/comparison/by_platform/func_build_compari son.rb
PFTT/lib/report/comparison/by_platform/perf_buil d_comparison.rb PFTT/lib/report/run/by_host/by_build/ by_middleware/func.rb
PFTT/lib/report/run/by_host/by_ build/func.rb PFTT/lib/report/run/per_host/per_build/pe r_middleware/func.rb PFTT/lib/report/triage.rb PFTT/s
cripts/SDK4Win/PFTT PFTT/scripts/SDK4Win/PHP PFTT/scrip ts/
Groups: php.qa 
Request: Send a blank email to php-qa+get-67156@lists.php.net to get a copy of this message
Commit: 90500eab112133f325137286e76af9c9121511f7 Author: Matt Ficken <v-mafick@.redmond.corp.microsoft.com> Sun, 23 Oct 2011 21:29:38 -0700 Parents: f87834959e87e7d4c8f4f13e76a782c2caa457db Branches: master Link: http://git.php.net/?p=pftt2.git;a=commitdiff;h=90500eab112133f325137286e76af9c9121511f7 Log: improvements to reports Changed paths: M PFTT/lib/report/comparison.rb M PFTT/lib/report/comparison/by_platform/func_build_comparison.rb M PFTT/lib/report/comparison/by_platform/perf_build_comparison.rb M PFTT/lib/report/run/by_host/by_build/by_middleware/func.rb M PFTT/lib/report/run/by_host/by_build/func.rb M PFTT/lib/report/run/per_host/per_build/per_middleware/func.rb A PFTT/lib/report/triage.rb A PFTT/scripts/SDK4Win/PFTT D PFTT/scripts/SDK4Win/PHP M PFTT/scripts/SDK4Win/SetupPHPSDK..cmd M PFTT/scripts/SDK4Win/Welcome.cmd A PFTT/scripts/SDK4Win/git_config.cmd A PFTT/scripts/SDK4Win/net_config.cmd

diff --git a/PFTT/lib/report/comparison.rb b/PFTT/lib/report/comparison.rb index 82f5314..e9498dd 100644 --- a/PFTT/lib/report/comparison.rb +++ b/PFTT/lib/report/comparison.rb @@ -9,14 +9,16 @@ module Report end def resultsets_comparison_url - # TODO a.run_id b.run_id - 'http://pftt_server/compare.php?a=a&b=b' + # see Server::PSB + "http://pftt_server/?report=fbc&base=#{@resultset_a.run_id}&test=#{@resultset_b.run_id}" end protected def diff_file(file_contents_a, file_contents_b) - # TODO file diff + diff = Diff::Exact.new(file_contents_a, file_contents_b) + + return diff.to_s end end end diff --git a/PFTT/lib/report/comparison/by_platform/func_build_comparison.rb b/PFTT/lib/report/comparison/by_platform/func_build_comparison.rb index 2501647..e2882d9 100644 --- a/PFTT/lib/report/comparison/by_platform/func_build_comparison.rb +++ b/PFTT/lib/report/comparison/by_platform/func_build_comparison.rb @@ -9,8 +9,7 @@ module Report end def write_intro - # TODO time, title - "<html><body><h1>#{title}</h1><p>Comparing @resultset_a.title (Base) with @resultset_b.title (Test) (using tests current as of @resultset_a.test_time</p><p>Click <a href=\"#{resultsets_comparison_url}\" target=\"_blank\">here</a> for a customizable comparison</p>" + "<html><body><h1>#{title}</h1><p>Comparing #{@resultset_a.title} (Base) with #{@resultset_b.title} (Test) (using tests current as of #{@resultset_a.test_time}</p><p>Click <a href=\"#{resultsets_comparison_url}\" target=\"_blank\">here</a> for a customizable comparison</p>" end def write_end @@ -29,8 +28,12 @@ module Report bgcolor_bad = '#ff0000' # + # table intrinsically does two builds and multiple hosts without making extra loops (just loop scenario, middleware and results) + + # TODO scenario [['context_1', 'context_2'], ['context_1', 'context_3']].each{|ctx_set| + # TODO middleware ['IIS with WinCache', 'IIS', 'Command Line', 'Apache with APC', 'Apache with APC and IGBinary', 'Apache'].each{|mw_txt| cm.add_row({:text=>(cm.html?)?'<strong>'+mw_txt+'</strong>':mw_txt, :colspan=>22, :center=>true}) cm.add_row( @@ -55,13 +58,16 @@ module Report {:text=>'', :bgcolor=>bgcolor_telemetry, :colspan=>2} ) + windows_ini = posix_ini = '' + results = ['A Result'] if results.empty? cm.add_row({:text=>'No Results', :colspan=>22, :center=>true}) else - results.each{|result| + # TODO results + results.each{|resultset| platform = 'Win 2003r2 x86 SP0, SP1' - pass_rate = 50 + pass_rate = resultset.rate change_pass_rate = -5 pass = 5000 change_pass = -100 @@ -109,26 +115,25 @@ module Report ) } - end - } - - cm.add_row( - {:text=>(cm.html?)?'<strong>Windows INI:</strong>':'INI:', :colspan=>2}, - # TODO show INI - {:text=>ctx_set.inspect.to_s, :colspan=>20} - ) - cm.add_row( - {:text=>(cm.html?)?'<strong>Linux INI:</strong>':'INI:', :colspan=>2}, - # TODO show INI - {:text=>ctx_set.inspect.to_s, :colspan=>20} - ) + end # end result - cm.add_row( - {:text=>(cm.html?)?'<strong>Scenarios:</strong>':'Scenarios:', :colspan=>2}, - {:text=>ctx_set.inspect.to_s, :colspan=>20} - ) + cm.add_row( + {:text=>(cm.html?)?'<strong>Windows INI:</strong>':'INI:', :colspan=>2}, + {:text=>windows_ini.to_s, :colspan=>20} + ) + cm.add_row( + {:text=>(cm.html?)?'<strong>Linux INI:</strong>':'INI:', :colspan=>2}, + {:text=>posix_ini.to_s, :colspan=>20} + ) + + cm.add_row( + {:text=>(cm.html?)?'<strong>Scenarios:</strong>':'Scenarios:', :colspan=>2}, + {:text=>ctx_set.inspect.to_s, :colspan=>20} + ) + + } # end middleware - } + } # end scenario return cm end diff --git a/PFTT/lib/report/comparison/by_platform/perf_build_comparison.rb b/PFTT/lib/report/comparison/by_platform/perf_build_comparison.rb index f73954d..0f68794 100644 --- a/PFTT/lib/report/comparison/by_platform/perf_build_comparison.rb +++ b/PFTT/lib/report/comparison/by_platform/perf_build_comparison.rb @@ -9,8 +9,7 @@ module Report end def write_intro - # TODO time, title - "<html><body><h1>#{title}</h1><p>Comparing performance of @resultset_a.title (Base) with @resultset_b.title (Test)</p><p>Click <a href=\"#{resultsets_comparison_url}\" target=\"_blank\">here</a> for a customizable comparison</p>" + "<html><body><h1>#{title}</h1><p>Comparing performance of #{@resultset_a.title} (Base) with #{@resultset_b.title} (Test)</p><p>Click <a href=\"#{resultsets_comparison_url}\" target=\"_blank\">here</a> for a customizable comparison</p>" end def write_end diff --git a/PFTT/lib/report/run/by_host/by_build/by_middleware/func.rb b/PFTT/lib/report/run/by_host/by_build/by_middleware/func.rb index 75ac439..b094bb9 100644 --- a/PFTT/lib/report/run/by_host/by_build/by_middleware/func.rb +++ b/PFTT/lib/report/run/by_host/by_build/by_middleware/func.rb @@ -5,6 +5,9 @@ module Report module ByBuild module ByMiddleware class Func < Base + def title + 'Functional Run(FR)' + end def write_text # colors to use bgcolor_os = '#f2f2f2' diff --git a/PFTT/lib/report/run/by_host/by_build/func.rb b/PFTT/lib/report/run/by_host/by_build/func.rb index 6f3834f..3ed766c 100644 --- a/PFTT/lib/report/run/by_host/by_build/func.rb +++ b/PFTT/lib/report/run/by_host/by_build/func.rb @@ -1,43 +1,43 @@ + module Report module Run module ByHost module ByBuild class Base < Base def write_text + + write_list() - write_list() - - - @builds.each do |build| - build.middlewares.each do |middleware| + @builds.each do |build| + build.middlewares.each do |middleware| - Report::Run::ByHost::ByBuild::ByMiddleware::Func.new(build, middleware) + Report::Run::ByHost::ByBuild::ByMiddleware::Func.new(build, middleware) - end - end + end + end - end + end - def write_list - # TODO list middlewares - end + def write_list + # TODO list middlewares + end - def write_html - - write_list() + def write_html + write_list() - @builds.each do |build| - build.middlewares.each do |middleware| + @builds.each do |build| + build.middlewares.each do |middleware| - Report::Run::ByHost::ByBuild::ByMiddleware::Func.new(build, middleware) + Report::Run::ByHost::ByBuild::ByMiddleware::Func.new(build, middleware) - end - end + end + end - end + end + end end end end -end \ No newline at end of file +end diff --git a/PFTT/lib/report/run/per_host/per_build/per_middleware/func.rb b/PFTT/lib/report/run/per_host/per_build/per_middleware/func.rb index 3932766..ad19977 100644 --- a/PFTT/lib/report/run/per_host/per_build/per_middleware/func.rb +++ b/PFTT/lib/report/run/per_host/per_build/per_middleware/func.rb @@ -7,6 +7,9 @@ module Report module PerBuild module PerMiddleware class Func < Base + def title + 'Function Host/Build/Middleware Combination Run(FCR)' + end def write_text r = @results # use 'r' because its a shorter name diff --git a/PFTT/lib/report/triage.rb b/PFTT/lib/report/triage.rb new file mode 100644 index 0000000..c370ca4 --- /dev/null +++ b/PFTT/lib/report/triage.rb @@ -0,0 +1,60 @@ + +module Report + class Triage < Base + def initialize(tr) + @tr = tr + end + + def write_text + cm = Util::ColumnManager::Text.new(9) + + write_table(cm) + + return "\r\n"+cm.to_s+"\r\n" + end + + def write_html + cm = Util::ColumnManager::Html.new + + write_table(cm) + + return "\r\n"+cm.to_s+"\r\n" + end + + protected + + def write_table(cm) + cm.add_row( + '', + {:text=>'Deleted', :colspan=>2}, + {:text=>'Inserted', :colspan=>2}, + {:text=>'Changed Length', :colspan=>2}, + {:text=>'Total', :colspan=>2} + ) + cm.add_row('Warning', @tr.deleted[:warnings].to_s, ((@tr.deleted[:warnings]/(@tr.deleted[:warnings]+@tr.inserted[:warnings]).to_f)*100.0).to_i.to_s+'%', @tr.inserted[:warnings].to_s, ((@tr.inserted[:warnings]/(@tr.deleted[:warnings]+@tr.inserted[:warnings]).to_f)*100.0).to_i.to_s+'%', 'n/a', '', (@tr.deleted[:warnings]+@tr.inserted[:warnings]).to_s, (((@tr.deleted[:warnings]+@tr.inserted[:warnings])/@tr.total_chunks.to_f)*100.0).to_i.to_s+'%') + cm.add_row('Error', @tr.deleted[:errors].to_s, ((@tr.deleted[:errors]/(@tr.deleted[:errors]+@tr.inserted[:errors]).to_f)*100.0).to_i.to_s+'%', @tr.inserted[:errors].to_s, ((@tr.deleted[:errors]/(@tr.deleted[:errors]+@tr.inserted[:errors]).to_f)*100.0).to_i.to_s+'%', 'n/a', '', (@tr.deleted[:errors]+@tr.inserted[:errors]).to_s, (((@tr.deleted[:errors]+@tr.inserted[:errors])/@tr.total_chunks.to_f)*100.0).to_i.to_s+'%') + cm.add_row('Array', @tr.deleted[:arrays].to_s, ((@tr.deleted[:arrays]/(@tr.deleted[:arrays]+@tr.inserted[:arrays]).to_f)*100.0).to_i.to_s+'%', @tr.inserted[:arrays].to_s, ((@tr.deleted[:arrays]/(@tr.deleted[:arrays]+@tr.inserted[:arrays]).to_f)*100.0).to_i.to_s+'%', @tr.changed_len[:arrays].to_s, ((@tr.changed_len[:arrays]/(@tr.changed_len[:arrays]+@tr.deleted[:arrays]+@tr.inserted[:arrays]).to_f)*100.0).to_i.to_s+'%', (@tr.changed_len[:arrays]+@tr.deleted[:arrays]+@tr.inserted[:arrays]).to_s, (((@tr.changed_len[:arrays]+@tr.deleted[:arrays]+@tr.inserted[:arrays])/@tr.total_chunks.to_f)*100.0).to_i.to_s+'%') + cm.add_row('String', @tr.deleted[:strings].to_s, ((@tr.deleted[:strings]/(@tr.deleted[:strings]+@tr.inserted[:strings]).to_f)*100.0).to_i.to_s+'%', @tr.inserted[:strings].to_s, ((@tr.deleted[:others]/(@tr.deleted[:others]+@tr.inserted[:others]).to_f)*100.0).to_i.to_s+'%', @tr.changed_len[:strings].to_s, ((@tr.changed_len[:strings]/(@tr.changed_len[:strings]+@tr.deleted[:strings]+@tr.inserted[:strings]).to_f)*100.0).to_i.to_s+'%', (@tr.changed_len[:strings]+@tr.deleted[:strings]+@tr.inserted[:strings]).to_s, (((@tr.changed_len[:strings]+@tr.deleted[:strings]+@tr.inserted[:strings])/@tr.total_chunks.to_f)*100.0).to_i.to_s+'%') + cm.add_row('Other', @tr.deleted[:others].to_s, ((@tr.deleted[:others]/(@tr.deleted[:others]+@tr.inserted[:others]).to_f)*100.0).to_i.to_s+'%', @tr.inserted[:others].to_s, ((@tr.inserted[:others]/(@tr.deleted[:others]+@tr.inserted[:others]).to_f)*100.0).to_i.to_s+'%', 'n/a', '', (@tr.deleted[:others]+@tr.inserted[:others]).to_s, (((@tr.deleted[:others]+@tr.inserted[:others])/@tr.total_chunks.to_f)*100.0).to_i.to_s+'%') + cm.add_row('Total', add(@tr.deleted), ((add(@tr.deleted)/add(@tr.deleted)+add(@tr.inserted).to_f)*100.0).to_i.to_s+'%', add(@tr.inserted), ((add(@inserted)/add(@tr.deleted)+add(@tr.inserted).to_f)*100.0).to_i.to_s+'%', 'n/a', '', (add(@tr.deleted)+add(@tr.inserted)).to_s, (((add(@tr.deleted)+add(@tr.inserted))/@tr.total_chunks.to_f)*100.0).to_i.to_s+'%') + cm.add_row({:text=>'', :colspan=>9}) + cm.add_row( + {:text=>'Total Lines', :colspan=>2}, + @tr.total_lines.to_s, + {:text=>'Total Chunks', :colspan=>2}, + @tr.total_chunks.to_s, + {:text=>'Diff Lines', :colspan=>2}, + @tr.diff_lines.to_s + ) + end + + def add(hash) + sum = 0 + hash.values.each do |n| + sum += n + end + return sum + end + + end +end diff --git a/PFTT/scripts/SDK4Win/PFTT SDK Shell.lnk b/PFTT/scripts/SDK4Win/PFTT SDK Shell.lnk new file mode 100644 index 0000000..c476640 Binary files /dev/null and b/PFTT/scripts/SDK4Win/PFTT SDK Shell.lnk differ diff --git a/PFTT/scripts/SDK4Win/PHP SDK Shell.lnk b/PFTT/scripts/SDK4Win/PHP SDK Shell.lnk deleted file mode 100644 index 5f5514d..0000000 Binary files a/PFTT/scripts/SDK4Win/PHP SDK Shell.lnk and /dev/null differ diff --git a/PFTT/scripts/SDK4Win/SetupPHPSDK.cmd b/PFTT/scripts/SDK4Win/SetupPHPSDK.cmd index 03eb8e9..2f859aa 100644 --- a/PFTT/scripts/SDK4Win/SetupPHPSDK.cmd +++ b/PFTT/scripts/SDK4Win/SetupPHPSDK.cmd @@ -5,7 +5,7 @@ set PHP_CMD_SHELL=1 set PHP_SDK=%SYSTEMDRIVE%\php-sdk set PHPT_BRANCH=%PHP_SDK%\svn\branches set PHP_BIN=%PHP_SDK%\bin -set PHP_BUILDS=%PHP_SDK%\builds +set PHPS=%PHP_SDK%\builds set PFTT_HOME=%PHP_SDK%\PFTT2\PFTT REM TODO TEMP use regular PFTT_HOME set PFTT_HOME=%PHP_SDK%\0\PFTT2\PFTT @@ -16,12 +16,21 @@ set PHP_DEPS=%PHP_SDK%\deps set PHP_DEP_LIBS=%PHP_DEPS\libs set PHP_DEP_INCLUDES=%PHP_DEPS\includes + +set PHP54_TS=%PHPS%\php-5.4-ts-windows-vc9-x86- +set PHP54_NTS=%PHPS%\php-5.4-nts-windows-vc9-x86- +set PHP55_TS=%PHPS%\php-5.5-ts-windows-vc9-x86- +set PHP55_NTS=%PHPS%\php-5.5-nts-windows-vc9-x86- + +REM set vars for shared network resources (if client is using a PFTT server) +CALL %PFTT_HOME%\scripts\SDK4Win\net_config.cmd + REM configure git (for pftt devs/encourge pftt users to become devs) -CALL %PFTT_HOME%\config\git_conf.cmd +CALL %PFTT_HOME%\scripts\SDK4Win\git_config.cmd IF NOT EXIST %PHP_SDK% MKDIR %PHP_SDK% IF NOT EXIST %PHPT_BRANCH% MKDIR %PHPT_BRANCH% -IF NOT EXIST %PHP_BUILDS% MKDIR %PHP_BUILDS% +IF NOT EXIST %PHPS% MKDIR %PHPS% IF NOT EXIST %PFTT_RESULTS% MKDIR %PFTT_RESULTS% IF NOT EXIST %PFTT_SCRIPTS% MKDIR %PFTT_SCRIPTS% IF NOT EXIST %PFTT_PHPS% MKDIR %PFTT_PHPS% diff --git a/PFTT/scripts/SDK4Win/Welcome.cmd b/PFTT/scripts/SDK4Win/Welcome.cmd index 8c2208f..032e8bf 100644 --- a/PFTT/scripts/SDK4Win/Welcome.cmd +++ b/PFTT/scripts/SDK4Win/Welcome.cmd @@ -1,15 +1,27 @@ @echo off echo. -echo PHP SDK for Windows -echo provided with PFTT +echo PFTT SDK for Windows +echo. echo. echo These Environment Variables may be useful: echo PHPT_BRANCH = %PHPT_BRANCH% -echo PHP_BUILDS = %PHP_BUILDS% +echo PHPS = %PHPS% +echo PHP_DEPS = %PHP_DEPS% echo PFTT_RESULTS = %PFTT_RESULTS% + +if DEFINED NET_PFTT_SERVER ( +echo. +echo NET_PHPT = shared location with latest PHPTs +echo NET_PHPS = shared location with PHP Builds +echo NET_PHPS54_TS = %%NET_PHPS%%\php-5.4-ts-windows-vc9-x86- +echo NET_PHPS54_NTS = %%NET_PHPS%%\php-5.4-nts-windows-vc9-x86- +echo. +echo ex: pftt func_full --phpt-dir=%%NET_PHPT%%\PHP_5_4 --php-dir=%%NET_PHP54_TS%%-r318303 +echo. +) + echo. -echo Run 'pftt' for PFTT Testing, etc... -echo Run 'rake' to make or subversion update +echo For everything, run 'pftt' echo Run 'last_pftt' to show output from last pftt command echo. echo. \ No newline at end of file diff --git a/PFTT/scripts/SDK4Win/git_config.cmd b/PFTT/scripts/SDK4Win/git_config.cmd new file mode 100644 index 0000000..e69de29 diff --git a/PFTT/scripts/SDK4Win/net_config.cmd b/PFTT/scripts/SDK4Win/net_config.cmd new file mode 100644 index 0000000..a9f6319 --- /dev/null +++ b/PFTT/scripts/SDK4Win/net_config.cmd @@ -0,0 +1,15 @@ + +REM +set NET_PFTT_SERVER="10.200.40.10" + +REM +set NET_PHPT=\\10.200.40.10\PHP\SVN\Branches + +REM +set NET_PHPS=\\10.200.40.10\PHP\PHP-Builds + + +set NET_PHP54_TS=%NET_PHPS%\php-5.4-ts-windows-vc9-x86- +set NET_PHP54_NTS=%NET_PHPS%\php-5.4-nts-windows-vc9-x86- +set NET_PHP55_TS=%NET_PHPS%\php-5.5-ts-windows-vc9-x86- +set NET_PHP55_NTS=%NET_PHPS%\php-5.5-nts-windows-vc9-x86-
« previous php.qa (#67156) next »