IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28707


Ignore:
Timestamp:
Jul 23, 2010, 3:55:02 PM (16 years ago)
Author:
rhenders
Message:

Cosmetic

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czarplot.pl

    r28704 r28707  
    1717my $save_temps = undef;
    1818my $interval = undef;
     19my $begin = undef;
     20my $end = undef;
    1921my $verbose = undef;
    2022my $histogram = undef;
     
    2628        "stage|s=s" => \$stage,
    2729        "interval|i=s" => \$interval,
     30        "begin|b=s" => \$begin,
     31        "end|e=s" => \$end,
    2832        "histogram|h" => \$histogram,
    2933        "timeseries|t" => \$timeSeries,
     
    4852    print "* OPTIONAL: choose an interval     -i <'1 hour'|'1 day'|etc>   (default=interval since 7am this morning)\n";
    4953}
     54if (!$begin) {
     55    print "* OPTIONAL: choose a begin time    -d <datetime>               (default=7am this morning)\n";
     56}
     57if (!$end) {
     58    print "* OPTIONAL: choose an end time     -e <datetime>               (default=now)\n";
     59}
    5060
    5161print "\n";
     
    6373my @allStages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
    6474
    65 my $toTime = $czarDb->getNowTimestamp();
    66 my $fromTime = undef;
     75# sort out times
     76if (!$end) {$end = $czarDb->getNowTimestamp();}
     77if (!$begin) {
     78    if ($interval) {$begin = $czarDb->getIntervalInPast($interval);}
     79    else {$begin =  strftime('%Y-%m-%d 07:00',localtime);}
     80}
    6781
    68 if ($interval) {$fromTime = $czarDb->getIntervalInPast($interval);}
    69 else {$fromTime =  strftime('%Y-%m-%d 07:00',localtime);}
    70 
    71 if ($histogram) {plotHistogram($label, $fromTime, $toTime);}
    72 if ($timeSeries) {plotTimeSeries($label, $stage, $fromTime, $toTime); }
     82if ($histogram) {plotHistogram($label, $begin, $end);}
     83if ($timeSeries) {plotTimeSeries($label, $stage, $begin, $end); }
    7384
    7485###########################################################################
     
    7889###########################################################################
    7990sub plotTimeSeries {
    80     my ($label, $selectedStage, $fromTime, $toTime) = @_;
     91    my ($label, $selectedStage, $beginTime, $endTime) = @_;
    8192
    8293    my ($minX, $maxX, $minY, $maxY, $timeDiff);
     
    93104    my %gnuplotFiles;
    94105    foreach $stage (@{$stages}) {
    95         $gnuplotFiles{$stage} = $czarDb->createTimeSeriesData($save_temps, $label, $stage, $fromTime, $toTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
     106        $gnuplotFiles{$stage} = $czarDb->createTimeSeriesData($save_temps, $label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
    96107    }
    97108
    98     if (!$selectedStage) {$gnuplot->plotAllStagesTimeSeries($label, $fromTime, $toTime, $maxX, $minX, $maxY, $minY, $timeDiff, \%gnuplotFiles);}
    99     else {$gnuplot->plotSingleTimeSeries($gnuplotFiles{$selectedStage}, $selectedStage, $label, $fromTime, $toTime, $maxX, $minX, $maxY, $minY, $timeDiff);}
     109    if (!$selectedStage) {$gnuplot->plotAllStagesTimeSeries($label, $beginTime, $endTime, $maxX, $minX, $maxY, $minY, $timeDiff, \%gnuplotFiles);}
     110    else {$gnuplot->plotSingleTimeSeries($gnuplotFiles{$selectedStage}, $selectedStage, $label, $beginTime, $endTime, $maxX, $minX, $maxY, $minY, $timeDiff);}
    100111
    101112}
     
    107118###########################################################################
    108119sub plotHistogram {
    109     my ($label, $fromTime, $toTime) = @_;
     120    my ($label, $beginTime, $endTime) = @_;
    110121
    111122    my ($tempFile, $filePath) = tempfile( "/tmp/czartool_gnuplot_histogram.XXXX", UNLINK => !$save_temps);
     
    114125    foreach $stage (@allStages) {
    115126
    116         $czarDb->countProcessedPendingAndFaults($label, $stage, $fromTime, $toTime, \$processed, \$pending, \$faults);
     127        $czarDb->countProcessedPendingAndFaults($label, $stage, $beginTime, $endTime, \$processed, \$pending, \$faults);
    117128        print $tempFile "$stage $processed, $pending, $faults\n";
    118129    }
     
    120131    close($tempFile);
    121132
    122     $gnuplot->plotHistogram($filePath, $label, $fromTime, $toTime);
     133    $gnuplot->plotHistogram($filePath, $label, $beginTime, $endTime);
    123134}
    124135
  • trunk/tools/roboczar.pl

    r28704 r28707  
    4747}
    4848
    49 
    5049###########################################################################
    5150#
     
    5453###########################################################################
    5554sub updateServerStatus {
    56     print "* Checking Servers\n";
     55    print "* Checking all pantasks servers\n";
    5756
    5857    my $servers = $pantasks->getServerList();
     
    104103            if ($str =~ m/on/) {$reverting = 1;}
    105104            else {$reverting = 0;}
    106             print "* Storing for stage $stage\n";
     105            print "* Checking labels for $stage stage\n";
    107106
    108107            foreach $row ( @{$rows} ) {
     
    178177}
    179178
    180 
    181179###########################################################################
    182180#
     
    195193    close(MAIL);
    196194}
    197 
    198 
Note: See TracChangeset for help on using the changeset viewer.