michael@0: ########################################################################################## michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: #------------------------------------------------------------------------------ michael@0: sub debug_print { michael@0: foreach $str (@_){ michael@0: # print( $str ); michael@0: } michael@0: } michael@0: michael@0: michael@0: #------------------------------------------------------------------------------ michael@0: # Variables michael@0: #------------------------------------------------------------------------------ michael@0: $Parse_Time_Max=0; michael@0: $Content_Time_Max=0; michael@0: $Frame_Time_Max=0; michael@0: $Style_Time_Max=0; michael@0: $Reflow_Time_Max=0; michael@0: $Layout_Time_Max=0; michael@0: $Total_Time_Max=0; michael@0: michael@0: @RecordList; michael@0: @LineList; michael@0: michael@0: #------------------------------------------------------------------------------ michael@0: # Open the history file and begin by collecting the records into the data-arrays michael@0: # and set all of the max-values too michael@0: #------------------------------------------------------------------------------ michael@0: $count=0; michael@0: open( HISTORY, "History.txt" ) or die "History file could not be opened\n"; michael@0: while() michael@0: { michael@0: my $PullID; michael@0: my $BuildID; michael@0: # - Time variables michael@0: my $Parse_Time=0; michael@0: my $Content_Time=0; michael@0: my $Frame_Time=0; michael@0: my $Style_Time=0; michael@0: my $Reflow_Time=0; michael@0: my $Layout_Time=0; michael@0: my $Total_Time=0; michael@0: # - percentage variables michael@0: my $Parse_Per=0; michael@0: my $Content_Per=0; michael@0: my $Frame_Per=0; michael@0: my $Style_Per=0; michael@0: my $Reflow_Per=0; michael@0: my $Layout_Per=0; michael@0: michael@0: $i=0; michael@0: $ThisLine = $_; michael@0: chop( $Thisline ); michael@0: @LineList = split( /,/, $ThisLine ); michael@0: michael@0: # get each value into a variable michael@0: $PullID = $LineList[$i++]; michael@0: $RecordList[$count++] = $PullID; michael@0: debug_print( "PullID : $PullID \n" ); michael@0: $BuildID = $LineList[$i++]; michael@0: $RecordList[$count++] = $BuildID; michael@0: debug_print( "BuildID : $BuildID \n" ); michael@0: michael@0: $Parse_Time = $LineList[$i++]; michael@0: $RecordList[$count++] = $Parse_Time; michael@0: debug_print( "Parse_Time : $Parse_Time \n" ); michael@0: $Parse_Per = $LineList[$i++]; michael@0: $RecordList[$count++] = $Parse_Per; michael@0: debug_print( "Parse_Per : $Parse_Per \n" ); michael@0: $Content_Time = $LineList[$i++]; michael@0: $RecordList[$count++] = $Content_Time; michael@0: debug_print( "Content_Time : $Content_Time \n" ); michael@0: $Content_Per = $LineList[$i++]; michael@0: $RecordList[$count++] = $Content_Per; michael@0: debug_print( "Content_Per : $Content_Per \n" ); michael@0: $Frame_Time = $LineList[$i++]; michael@0: $RecordList[$count++] = $Frame_Time; michael@0: debug_print( "Frame_Time : $Frame_Time \n" ); michael@0: $Frame_Per = $LineList[$i++]; michael@0: $RecordList[$count++] = $Frame_Per; michael@0: debug_print( "Frame_Per : $Frame_Per \n" ); michael@0: $Style_Time = $LineList[$i++]; michael@0: $RecordList[$count++] = $Style_Time; michael@0: debug_print( "Style_Time : $Style_Time \n" ); michael@0: $Style_Per = $LineList[$i++]; michael@0: $RecordList[$count++] = $Style_Per; michael@0: debug_print( "Style_Per : $Style_Per \n" ); michael@0: $Reflow_Time = $LineList[$i++]; michael@0: $RecordList[$count++] = $Reflow_Time; michael@0: debug_print( "Reflow_Time : $Reflow_Time \n" ); michael@0: $Reflow_Per = $LineList[$i++]; michael@0: $RecordList[$count++] = $Reflow_Per; michael@0: debug_print( "Reflow_Per : $Reflow_Per \n" ); michael@0: $Layout_Time = $LineList[$i++]; michael@0: $RecordList[$count++] = $Layout_Time; michael@0: debug_print( "Layout_Time : $Layout_Time \n" ); michael@0: $Layout_Per = $LineList[$i++]; michael@0: $RecordList[$count++] = $Layout_Per; michael@0: debug_print( "Layout_Per : $Layout_Per \n" ); michael@0: $Total_Time = $LineList[$i++]; michael@0: $RecordList[$count++] = $Total_Time; michael@0: debug_print( "Total_Time : $Total_Time \n" ); michael@0: michael@0: # Now check for max values michael@0: if( $Parse_Time > $Parse_Time_Max ){ michael@0: $Parse_Time_Max = $Parse_Time; michael@0: debug_print( "ParseTimeMax: .$Parse_Time_Max\n"); michael@0: } michael@0: if( $Content_Time > $Content_Time_Max ){ michael@0: $Content_Time_Max = $Content_Time; michael@0: debug_print( "Content_Time_Max: $Content_Time_Max\n"); michael@0: } michael@0: if( $Frame_Time > $Frame_Time_Max ){ michael@0: $Frame_Time_Max = $Frame_Time; michael@0: debug_print( "Frame_Time_Max: $Frame_Time_Max\n"); michael@0: } michael@0: if( $Style_Time > $Style_Time_Max ){ michael@0: $Style_Time_Max = $Style_Time; michael@0: debug_print( "Style_Time_Max: $Style_Time_Max\n"); michael@0: } michael@0: if( $Reflow_Time > $Reflow_Time_Max ){ michael@0: $Reflow_Time_Max = $Reflow_Time; michael@0: debug_print( "Reflow_Time_Max: $Reflow_Time_Max\n"); michael@0: } michael@0: if( $Layout_Time > $Layout_Time_Max ){ michael@0: $Layout_Time_Max = $Layout_Time; michael@0: debug_print( "Layout_Time_Max: $Layout_Time_Max\n"); michael@0: } michael@0: michael@0: if( $Total_Time > $Total_Time_Max ){ michael@0: $Total_Time_Max = $Total_Time; michael@0: debug_print( "Total_Time_Max: $Total_Time_Max\n"); michael@0: } michael@0: } michael@0: close(HISTORY); michael@0: michael@0: for $foo (@RecordList){ michael@0: # print( "FOO: $foo \n" ); michael@0: } michael@0: ProcessHeader(); michael@0: for($index=0; $index<($count/15); $index++) michael@0: { michael@0: my $start = 15*$index; michael@0: my $end = $start+15; michael@0: print( "Start: $start -> End: $end\n"); michael@0: my @entry = @RecordList[$start..$end]; michael@0: print( "Processing entry $index\n"); michael@0: ProcessEntry( @entry ); michael@0: } michael@0: ProcessFooter(); michael@0: michael@0: #------------------------------------------------------------------------------ michael@0: # michael@0: sub ProcessHeader { michael@0: debug_print("ProcessHeader\n"); michael@0: michael@0: ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime; michael@0: %weekday= ( michael@0: "1", "$day", michael@0: '2', 'Tuesday', michael@0: '3', 'Wednesday', michael@0: '4', 'Thursday', michael@0: '5', 'Friday', michael@0: '6', 'Saturday', michael@0: '7', 'Sunday', michael@0: ); michael@0: $mon += 1; michael@0: $year += 1900; michael@0: michael@0: open(TRENDTABLE, "> TrendTable.html") or die "Cannot open trend-table file (TrendTable.html) in ProcessHeader\n"; michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "

Performance History and Trending Table


\n" ); michael@0: print (TRENDTABLE "
"); michael@0: print (TRENDTABLE "$weekday{$wday} "); michael@0: print (TRENDTABLE "$mon/$mday/$year "); michael@0: printf (TRENDTABLE "%02d:%02d:%02d", $hour, $min, $sec); michael@0: print (TRENDTABLE "
"); michael@0: print (TRENDTABLE "
"); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: close(TRENDTABLE); michael@0: } michael@0: michael@0: #------------------------------------------------------------------------------ michael@0: # michael@0: sub ProcessEntry { michael@0: michael@0: my $PullID; michael@0: my $BuildID; michael@0: # - Time variables michael@0: my $Parse_Time=0; michael@0: my $Content_Time=0; michael@0: my $Frame_Time=0; michael@0: my $Style_Time=0; michael@0: my $Reflow_Time=0; michael@0: my $Layout_Time=0; michael@0: my $Total_Time=0; michael@0: # - percentage variables michael@0: my $Parse_Per=0; michael@0: my $Content_Per=0; michael@0: my $Frame_Per=0; michael@0: my $Style_Per=0; michael@0: my $Reflow_Per=0; michael@0: my $Layout_Per=0; michael@0: # - weight variables michael@0: my $Parse_Weight=0; michael@0: my $Content_Weight=0; michael@0: my $Frame_Weight=0; michael@0: my $Style_Weight=0; michael@0: my $Reflow_Weight=0; michael@0: my $Layout_Weight=0; michael@0: my $Total_Weight=0; michael@0: michael@0: debug_print( "Process Entry\n" ); michael@0: my @EntryLine =@_; michael@0: michael@0: open(TRENDTABLE, ">> TrendTable.html") or die "Cannot open trend-table file (TrendTable.html) in ProcessHeader\n"; michael@0: $i=0; michael@0: $PullID = $EntryLine[$i++]; michael@0: debug_print( "PullID: $PullID \n" ); michael@0: $BuildID = $EntryLine[$i++]; michael@0: debug_print( "BuildID: $BuildID \n" ); michael@0: $Parse_Time = $EntryLine[$i++]; michael@0: debug_print( "Parse_Time : $Parse_Time \n" ); michael@0: $Parse_Per = $EntryLine[$i++]; michael@0: debug_print( "Parse_Per : $Parse_Per \n" ); michael@0: $Content_Time = $EntryLine[$i++]; michael@0: debug_print( "Content_Time : $Content_Time \n" ); michael@0: $Content_Per = $EntryLine[$i++]; michael@0: debug_print( "Content_Per : $Content_Per \n" ); michael@0: $Frame_Time = $EntryLine[$i++]; michael@0: debug_print( "Frame_Time : $Frame_Time \n" ); michael@0: $Frame_Per = $EntryLine[$i++]; michael@0: debug_print( "Frame_Per : $Frame_Per \n" ); michael@0: $Style_Time = $EntryLine[$i++]; michael@0: debug_print( "Style_Time : $Style_Time \n" ); michael@0: $Style_Per = $EntryLine[$i++]; michael@0: debug_print( "Style_Per : $Style_Per \n" ); michael@0: $Reflow_Time = $EntryLine[$i++]; michael@0: debug_print( "Reflow_Time : $Reflow_Time \n" ); michael@0: $Reflow_Per = $EntryLine[$i++]; michael@0: debug_print( "Reflow_Per : $Reflow_Per \n" ); michael@0: $Layout_Time = $EntryLine[$i++]; michael@0: debug_print( "Layout_Time : $Layout_Time \n" ); michael@0: $Layout_Per = $EntryLine[$i++]; michael@0: debug_print( "Layout_Per : $Layout_Per \n" ); michael@0: $Total_Time = $EntryLine[$i++]; michael@0: debug_print( "Total_Time : $Total_Time \n" ); michael@0: michael@0: if( $Parse_Time_Max > 0 ){ michael@0: $ParseWeight = $Parse_Time / $Parse_Time_Max * 100; michael@0: debug_print( "ParseWeight = $ParseWeight \n" ); michael@0: } michael@0: if( $Content_Time_Max > 0 ){ michael@0: $ContentWeight = $Content_Time / $Content_Time_Max * 100; michael@0: debug_print( "ContentWeight = $ContentWeight \n" ); michael@0: } michael@0: if( $Frame_Time_Max > 0 ){ michael@0: $FrameWeight = $Frame_Time / $Frame_Time_Max * 100; michael@0: debug_print( "FrameWeight = $FrameWeight \n" ); michael@0: } michael@0: if( $Style_Time_Max > 0 ){ michael@0: $StyleWeight = $Style_Time / $Style_Time_Max * 100; michael@0: debug_print( "StyleWeight = $StyleWeight \n" ); michael@0: } michael@0: if( $Reflow_Time_Max > 0 ){ michael@0: $ReflowWeight = $Reflow_Time / $Reflow_Time_Max * 100; michael@0: debug_print( "ReflowWeight = $ReflowWeight \n" ); michael@0: } michael@0: if( $Layout_Time_Max > 0 ){ michael@0: $LayoutWeight = $Layout_Time / $Layout_Time_Max * 100; michael@0: debug_print( "LayoutWeight = $LayoutWeight \n" ); michael@0: } michael@0: if( $Total_Time_Max > 0 ){ michael@0: $TotalWeight = $Total_Time / $Total_Time_Max * 100; michael@0: debug_print( "TotalWeight = $TotalWeight \n" ); michael@0: } michael@0: michael@0: $bldID; michael@0: @bldIDParts = split( /:/, $BuildID ); michael@0: $bldID = $bldIDParts[1]; michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE " \n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: print(TRENDTABLE "\n"); michael@0: michael@0: close(TRENDTABLE); michael@0: } michael@0: michael@0: #------------------------------------------------------------------------------ michael@0: # michael@0: sub ProcessFooter { michael@0: debug_print("ProcessHeader\n"); michael@0: open(TRENDTABLE, ">> TrendTable.html") or die "Cannot open trend-table file (TrendTable.html) in ProcessFooter\n"; michael@0: michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "Pull-ID\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Build-ID\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Parsing\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Content Creation\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Frame Creation\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Style Resolution\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Reflow\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Total Layout\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "Total Time\n" ); michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "
Sec%
\n" ); michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "
Sec%
\n" ); michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "
Sec%
\n" ); michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "
Sec%
\n" ); michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "
Sec%
\n" ); michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "
Sec%
\n" ); michael@0: print(TRENDTABLE "
\n" ); michael@0: print(TRENDTABLE "\n" ); michael@0: print(TRENDTABLE "
Sec
\n" ); michael@0: print(TRENDTABLE "
$PullID$bldID\n"); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.3f", $Parse_Time); michael@0: print(TRENDTABLE ""); michael@0: printf(TRENDTABLE "%4.3f",$Parse_Per); michael@0: print(TRENDTABLE "
 "); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.2f % ", $ParseWeight); michael@0: print(TRENDTABLE "
\n"); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.3f",$Content_Time); michael@0: print(TRENDTABLE ""); michael@0: printf(TRENDTABLE "%4.3f",$Content_Per); michael@0: print(TRENDTABLE "
 "); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.2f % ", $ContentWeight); michael@0: print(TRENDTABLE "
\n"); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.3f",$Frame_Time); michael@0: print(TRENDTABLE " "); michael@0: printf(TRENDTABLE "%4.3f",$Frame_Per); michael@0: print(TRENDTABLE "
 "); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.2f % ", $FrameWeight); michael@0: print(TRENDTABLE "
\n"); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.3f",$Style_Time); michael@0: print(TRENDTABLE ""); michael@0: printf(TRENDTABLE "%4.3f",$Style_Per); michael@0: print(TRENDTABLE "
 "); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.2f % ", $StyleWeight); michael@0: print(TRENDTABLE "
\n"); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.3f",$Reflow_Time); michael@0: print(TRENDTABLE ""); michael@0: printf(TRENDTABLE "%4.3f",$Reflow_Per); michael@0: print(TRENDTABLE "
 "); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.2f % ", $ReflowWeight); michael@0: print(TRENDTABLE "
\n"); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.3f",$Layout_Time); michael@0: print(TRENDTABLE ""); michael@0: printf(TRENDTABLE "%4.3f",$Layout_Per); michael@0: print(TRENDTABLE "
 "); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.2f % ", $LayoutWeight); michael@0: print(TRENDTABLE "
\n"); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.3f",$Total_Time); michael@0: print(TRENDTABLE "
 "); michael@0: print(TRENDTABLE "
"); michael@0: printf(TRENDTABLE "%4.2f % ", $TotalWeight); michael@0: print(TRENDTABLE "
\n"); michael@0: print(TRENDTABLE "\n"); michael@0: michael@0: close(TRENDTABLE); michael@0: }