common/tools/analysis/parse_yarp_files.pl
changeset 200 0b9c56a7a618
child 202 66da43a8fbf8
equal deleted inserted replaced
199:7bcb8b1ad9a6 200:0b9c56a7a618
       
     1 
       
     2 my @asYarpFiles = ();
       
     3 open(FILE, $ARGV[0]);
       
     4 while ( <FILE> )
       
     5 {
       
     6 	if ( m/[^,]*,([^,]*)/ )
       
     7 	{
       
     8 		my $sFile = $1;
       
     9 		chomp $sFile;
       
    10 #		print "$sFile\n";
       
    11 		push(@asYarpFiles, $sFile);
       
    12 	}
       
    13 }
       
    14 close(FILE);
       
    15 my $nYarpFiles = scalar(@asYarpFiles);
       
    16 #print "Found $nYarpFiles files to parse\n";
       
    17 
       
    18 my $nTotalRecipeErrors = 0;
       
    19 for my $nYarpFile (@asYarpFiles)
       
    20 {
       
    21 	my $nRecipeErrors = 0;
       
    22 #	print "Parsing file $nYarpFile...\n";
       
    23 	open(FILE, $nYarpFile);
       
    24 	while ( <FILE> )
       
    25 	{
       
    26 		if ( m/Overall attempts:\s*(\d+),(\d+)/ )
       
    27 		{
       
    28 			print "Attempt: $1 Errors: $2\n";
       
    29 			$nRecipeErrors = $2;
       
    30 		}
       
    31 	}
       
    32 	close(FILE);
       
    33 #	print "Recipe errors in $nYarpFile: $nRecipeErrors\n";
       
    34 	$nTotalRecipeErrors += $nRecipeErrors;
       
    35 }
       
    36 #print "Total recipe errors across all files: $nTotalRecipeErrors\n";
       
    37 
       
    38 print "$nTotalRecipeErrors";