IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 7, 2010, 9:16:10 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/ipp-20100823
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100823

  • branches/eam_branches/ipp-20100823/tools/roboczar.pl

    r28926 r29124  
    1111use czartool::Pantasks;
    1212use czartool::Nebulous;
    13 use czartool::Czarplot;
     13use czartool::Plotter;
     14use czartool::Burntool;
    1415
    1516my $period = 60;
     
    2627my $nebulous = new czartool::Nebulous($czarDb);
    2728my $pantasks = new czartool::Pantasks();
    28 my $czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8", "/tmp", $save_temps); # TODO hardcoded font path
     29my $plotter = new czartool::Plotter($czarDb, "%Y%m%d-%H%M%S", "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8", "/tmp", $save_temps); # TODO hardcoded font path
     30my $burntool = new czartool::Burntool();
     31
    2932$czarDb->setDateFormat("%Y%m%d-%H%i%s");
    3033
    31 my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
     34my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
    3235
    3336
     
    101104    my $priority = undef;
    102105    my $newState = undef;
     106    my $nsStatus = undef;
    103107
    104108    while (1) {
    105109
    106110        # sort out times
    107         $begin =  strftime('%Y-%m-%d 07:00',localtime);
     111        $begin =  strftime('%Y-%m-%d 06:35',localtime);
    108112        $end = $czarDb->getNowTimestamp();
    109113
     
    112116            $begin = $czarDb->subtractInterval($begin, "1 DAY");
    113117        }
     118
     119        # check nightly science status
     120        print "* Checking nightly science status\n";
     121        if (!$pantasks->getNightlyScienceStatus(\$nsStatus)) {$nsStatus = "Unknown";}
     122        $czarDb->updateNightlyScience($nsStatus);
    114123
    115124        # check nebulous
    116125        print "* Checking Nebulous\n";
    117126        $nebulous->updateClusterSpaceInfo();
    118         $czarplot->plotDiskUsageHistogram();
     127        $plotter->plotDiskUsageHistogram();
    119128        updateServerStatus();
    120129
     
    177186
    178187            chomp($label);
    179             $czarplot->createTimeSeries($label,  $stage, $begin, $end);
     188            $plotter->createLogAndLinearTimeSeries($label,  $stage, $begin, $end);
    180189        }
    181190    }
     
    185194        my ($label) = @{$row};
    186195
    187         $czarplot->createTimeSeries($label, undef, $begin, $end);
    188         $czarplot->createHistogram($label, $begin, $end);
     196        $plotter->createLogAndLinearTimeSeries($label, undef, $begin, $end);
     197        $plotter->createHistogram($label, $begin, $end);
    189198
    190199        #routineChecks($label, "1 HOUR");
    191200    }
    192     $czarplot->createTimeSeries("all_".$server."_labels", undef, $begin, $end);
    193     $czarplot->createHistogram("all_".$server."_labels", $begin, $end);
     201    $plotter->createLogAndLinearTimeSeries("all_".$server."_labels", undef, $begin, $end);
     202    $plotter->createHistogram("all_".$server."_labels", $begin, $end);
    194203    foreach $stage (@stages) {
    195204
    196         $czarplot->createTimeSeries("all_".$server."_labels",  $stage, $begin, $end); # TODO must be a neater way...
     205        $plotter->createLogAndLinearTimeSeries("all_".$server."_labels",  $stage, $begin, $end); # TODO must be a neater way...
    197206    }
    198207}
     
    233242            chomp($label);
    234243
    235             $new = $gpc1Db->countExposures($label, $stage, $newState);
    236             $full = $gpc1Db->countExposures($label, $stage, "full");
    237             $faults = $gpc1Db->countFaults($label, $stage, $newState);
    238 
     244            if ($stage eq "burntool") {
     245
     246                if ($labelServer eq "stdscience") {
     247
     248                    $burntool->getPendingAndProcessed($label, \$new, \$full);
     249                    $faults = 0;
     250                }
     251                else { $new = $full = $faults = 0;}
     252            }
     253            else {
     254
     255                $new = $gpc1Db->countExposures($label, $stage, $newState);
     256                $full = $gpc1Db->countExposures($label, $stage, "full");
     257                $faults = $gpc1Db->countFaults($label, $stage, $newState);
     258            }
    239259            #printf("%s  %s, %s, %d, %d\n", $labelServer, $label, $stage, $new, $faults);
    240260            $totalNew += $new;
Note: See TracChangeset for help on using the changeset viewer.