tools/performance/layout/genfromlogs.pl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/performance/layout/genfromlogs.pl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +##########################################################################################
     1.5 +#
     1.6 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.9 +
    1.10 +@ARGV;
    1.11 +$milestone = $ARGV[0];
    1.12 +print ($milestone);
    1.13 +
    1.14 +$bldRoot = $ARGV[1];
    1.15 +print(" BuildRoot: $bldRoot\n");
    1.16 +$cnt = 0;
    1.17 +
    1.18 +# Backup the history file
    1.19 +system( ("copy", "history.txt", "history.bak" ) );
    1.20 +
    1.21 +# Delete the average.txt file so we don;t get old values in the averages
    1.22 +if (-e "average.txt")
    1.23 +{
    1.24 +	system( ("del", "average.txt") );
    1.25 +}
    1.26 +
    1.27 +# Run the Header script
    1.28 +system( ("perl", "header.pl", "$bldRoot", "$milestone", "$ARGV[2]" ) );
    1.29 +
    1.30 +#
    1.31 +# now run the average2 script for each file in the logs directory
    1.32 +#
    1.33 +while( <Logs\\*.txt> ){
    1.34 +  $line = $_;
    1.35 +  $cnt++;
    1.36 +  if ($line =~ /-log.txt/ ){
    1.37 +    print( "File $cnt: $line\t" );
    1.38 +    @nameParts = split( /-/, $line );
    1.39 +    @nameNoDir = split( /\\/, $nameParts[0] );
    1.40 +    print( "Name: $nameNoDir[1]\n" );
    1.41 +    if ($nameNoDir[1] eq "") {
    1.42 +      print ("Skipping $line\n");
    1.43 +    } else {
    1.44 +      system( ("perl", "Averagetable2.pl", "$nameNoDir[1]", "$line", "$cnt", "$bldRoot", "$nameNoDir[1]", "$ARGV[2]" ) );
    1.45 +    }
    1.46 +  } else {
    1.47 +    print ("Skipping file $line\n");
    1.48 +  }
    1.49 +}
    1.50 +
    1.51 +# Run the Footer script
    1.52 +system( ("perl", "footer.pl", "$bldRoot", "$milestone" ) );
    1.53 +
    1.54 +print("Processed $cnt logs\n");

mercurial