IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 8, 2015, 10:49:55 AM (11 years ago)
Author:
bills
Message:

Initial work to support two IPP databases (gpc1 and gpc2). Plotting stuff
doesn't work but updates of the stage tables does

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/czartool/czarpoll.pl

    r38206 r38250  
    3232my $czarDb = $config->getCzarDbInstance();
    3333my $gpc1Db = $config->getGpc1Instance;
     34my $gpc2Db = $config->getGpc2Instance;
    3435my $nebulous = new czartool::Nebulous($czarDb);
    3536my $pantasks = new czartool::Pantasks();
     
    4748        "fullforce",
    4849        "dist",
     50        "fullforce",
    4951        "pub");
    5052
     
    331333
    332334    print "* Updating stage data\n";
    333     my $totalNew = undef;
    334     my $totalFaults = undef;
    335     my $totalFull = undef;
     335    my $totalNew1 = 0;
     336    my $totalFaults1 = 0;
     337    my $totalFull1 = 0;
     338    my $totalNew2 = 0;
     339    my $totalFaults2 = 0;
     340    my $totalFull2 = 0;
    336341    my $stage = undef;
    337342    my $reverting = 0;
     
    352357        print "* Checking labels for $stage stage\n";
    353358
    354         $totalNew=$totalFaults=$totalFull=0;
     359        $totalNew1=$totalFaults1=$totalFull1=0;
     360        $totalNew2=$totalFaults2=$totalFull2=0;
    355361        foreach $row ( @{$rows} ) {
    356362            my ($label) = @{$row};
     
    358364            chomp($label);
    359365
    360             if ($stage eq "burntool") {
    361 
    362                 $new = $full = $faults = 0;
    363                 if ($labelServer eq "stdscience") {
    364 
    365                     $full = $gpc1Db->countRegisteredExposures($label, $today);
    366                 }
    367             }
    368             else {
    369 
    370                 $new = $gpc1Db->countExposures($label, $stage, $newState);
    371                 $full = $gpc1Db->countExposures($label, $stage, "full");
    372                 $faults = $gpc1Db->countFaults($label, $stage, $newState);
    373             }
     366            $new = $gpc1Db->countExposures($label, $stage, $newState);
     367            $full = $gpc1Db->countExposures($label, $stage, "full");
     368            $faults = $gpc1Db->countFaults($label, $stage, $newState);
    374369            #printf("%s  %s, %s, %d, %d\n", $labelServer, $label, $stage, $new, $faults);
    375             $totalNew += $new;
    376             $totalFull += $full;
    377             $totalFaults += $faults;
    378 
    379             $czarDb->insertNewTimeData($stage, $label, $new, $full, $faults);
    380         }
    381 
    382         $czarDb->insertNewTimeData($stage, "all_".$labelServer."_labels", $totalNew, $totalFull, $totalFaults);
    383     }
    384 }
    385 
     370            $totalNew1 += $new;
     371            $totalFull1 += $full;
     372            $totalFaults1 += $faults;
     373
     374            $czarDb->insertNewTimeData($stage, $label, 'gpc1', $new, $full, $faults);
     375
     376            $new = $gpc2Db->countExposures($label, $stage, $newState);
     377            $full = $gpc2Db->countExposures($label, $stage, "full");
     378            $faults = $gpc2Db->countFaults($label, $stage, $newState);
     379            #printf("%s  %s, %s, %d, %d\n", $labelServer, $label, $stage, $new, $faults);
     380            $totalNew2 += $new;
     381            $totalFull2 += $full;
     382            $totalFaults2 += $faults;
     383
     384            $czarDb->insertNewTimeData($stage, $label, 'gpc2', $new, $full, $faults);
     385        }
     386
     387        $czarDb->insertNewTimeData($stage, "all_".$labelServer."_labels", 'gpc1', $totalNew1, $totalFull1, $totalFaults1);
     388        $czarDb->insertNewTimeData($stage, "all_".$labelServer."_labels", 'gpc2', $totalNew2, $totalFull2, $totalFaults2);
     389    }
     390}
     391
Note: See TracChangeset for help on using the changeset viewer.