IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26672


Ignore:
Timestamp:
Jan 22, 2010, 12:25:48 PM (16 years ago)
Author:
watersc1
Message:

Added a new table at the end to show how many distribution faults there are.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/wiki_nightly_stacks_table.pl

    r26670 r26672  
    44use Getopt::Std;
    55
    6 getopts('P',\%opt);
     6getopts('PC',\%opt);
    77
    88$dbname = 'gpc1';
     
    281281    print '||' . "\n";
    282282}
     283print '||' . "\n";
     284# faulted distributed
     285
     286$sth = "select * from rcDSFileset join distRun using(dist_id) where rcDSFileset.fault > 0 and date(registered) >= '2010-01-01' AND label LIKE 'M%.nightlystack' order by fs_id asc";
     287$data_ref = $db->selectall_arrayref( $sth );
     288
     289foreach $rr (@{ $data_ref }) {
     290#    ($dist_id,$fs_id,$dest_id,$name,$state,$registered,$fault,$target_id,$stage,$stage_id,$magic_ds_id,$label,$outroot,$outdir,$clean,$no_magic,$state2,$time_stamp,$fault,$data_group,$note) = @{ $rr };
     291   
     292    $data_group = ${ $rr }[19];
     293    ($dist_group,$date_str) = split /\./, $data_group;
     294    $date = sprintf("%d%d%d%d-%d%d-%d%d",(split //,$date_str));
     295   
     296    unless(defined($fault_diststacks{$date}{$dist_group})) {
     297        $fault_diststacks{$date}{$dist_group} = 0;
     298    }
     299   
     300    $fault_diststacks{$date}{$dist_group} ++;
     301
     302    if (exists($opt{C})) {
     303        print STDERR "## disttool -dbname gpc1 -revertfileset -fs_id ${ $rr }[1]\n";
     304    }
     305
     306}
     307
     308print "|| '''Faulted Dists (Nstack_ids):'''\n||\n";
     309print '|| Date ||';
     310foreach $t (@targets) {
     311    print "$t ||";
     312}
     313print "\n";
     314
     315foreach $d (sort (keys %diststacks)) {
     316    print '||' . $d ;
     317    foreach $t (@targets) {
     318        print '|| ' ;
     319        $i = 0;
     320        if (exists($fault_diststacks{$d}{$t})) {
     321            print "$fault_diststacks{$d}{$t}";
     322        }
     323    }
     324    print '||' . "\n";
     325}
    283326print "\n\n";
    284 
Note: See TracChangeset for help on using the changeset viewer.