IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 21, 2010, 2:45:13 PM (16 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100823/tools/czarplot.pl

    r29124 r29515  
    1717my $begin = undef;
    1818my $end = undef;
     19my $day = undef;
    1920my $path = undef;
    2021my $verbose = undef;
    2122my $histogram = undef;
    2223my $timeSeries = undef;
     24my $rate = undef;
     25my $deriv = undef;
     26my $showCleanup = undef;
    2327my $nebulous = undef;
    2428my $savingToFile = undef;
     
    2630
    2731GetOptions (
    28         "dbname|d=s" => \$czarDbName,
     32        "dbname=s" => \$czarDbName,
    2933        "label|l=s" => \$label,
    3034        "stage|s=s" => \$stage,
     
    3236        "begin|b=s" => \$begin,
    3337        "end|e=s" => \$end,
     38        "day|y=s" => \$day,
    3439        "output|o=s" => \$path,
    3540        "histogram|h" => \$histogram,
    3641        "nebulous|n" => \$nebulous,
     42        "cleanup|c" => \$showCleanup,
     43        "rate|r" => \$rate,
     44        "deriv|d" => \$deriv,
    3745        "timeseries|t" => \$timeSeries,
    3846        "verbose|v" => \$verbose,
     
    5159if (!$timeSeries) {
    5260    print "* OPTIONAL: plot timeseries                 -t                          (default=on)\n";}
     61if (!$rate) {
     62    print "* OPTIONAL: plot timeseries of rate         -r                          (default=off)\n";}
     63if (!$deriv) {
     64    $deriv = 0;
     65    print "* OPTIONAL: plot first derivative           -d                          (default=$deriv)\n";}
     66if (!$showCleanup) {
     67    $showCleanup = 0;
     68    print "* OPTIONAL: include cleanup in timeseries   -c                          (default=$showCleanup)\n";}
    5369if (!$log) {
    5470    $log = 0;
     
    6480    print "* OPTIONAL: choose time interval in past    -i <'1 hour'|'1 day'|etc>   (default=none\n";}
    6581if (!$begin) {
    66     print "* OPTIONAL: choose a begin time             -b <datetime>               (default=7am this morning)\n";}
     82    print "* OPTIONAL: choose a begin time             -b <datetime>               (default=6:35am this morning)\n";}
    6783if (!$end) {
    6884    print "* OPTIONAL: choose an end time              -e <datetime>               (default=now)\n";}
     85if (!$day) {
     86    print "* OPTIONAL: choose a single day to plot     -y <date>                   (default=today)\n";}
    6987if (!$path) {
    7088    print "* OPTIONAL: choose an output location       -o <path>                   (default=none)\n";
     
    85103
    86104
    87 # GENE PLOTS my $plotter = new czartool::Plotter($czarDb, "%Y%m%d-%H%M%S", $savingToFile ? "png size 1280,960 font \"/usr/share/fonts/corefonts/arial.ttf\" 12" : "X11", $path, $save_temps);
    88 my $plotter = new czartool::Plotter($czarDb, "%Y%m%d-%H%M%S", $savingToFile ? "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8" : "X11", $path, $save_temps);
     105my $plotter = new czartool::Plotter(
     106        $czarDb,
     107        "%Y%m%d-%H%M%S",
     108        $savingToFile ? "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8" : "X11",
     109        $path,
     110        $save_temps);
    89111
    90112# sort out times
    91 if (!$end) {$end = $czarDb->getNowTimestamp();}
    92 if (!$begin) {
    93     if ($interval) {$begin = $czarDb->subtractInterval($end, $interval);}
    94     else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
     113if($day) {
     114
     115    # day plots should run from about 6:30am until midnight
     116    $begin =  "$day 06:35";
     117    $end = "$day 23:59";
    95118}
     119else {
    96120
     121    if (!$end) {$end = $czarDb->getNowTimestamp();}
     122    if (!$begin) {
     123
     124        if ($interval) {$begin = $czarDb->subtractInterval($end, $interval);}
     125        else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
     126    }
     127}
    97128my $diskUsage = 1; # TODO
    98129
    99 if (!$nebulous && $timeSeries) {$plotter->createTimeSeries($label, $stage, $begin, $end, $log);}
     130if ($rate) {
     131
     132    if (!$interval) {$interval = "1 HOUR";}
     133    $plotter->createRateTimeSeries($label, $stage, $begin, $end, $interval, $log);
     134    exit;
     135}
     136if (!$nebulous && $timeSeries) {$plotter->createTimeSeries($label, $stage, $begin, $end, $log, $showCleanup, $deriv);}
    100137if ($histogram) {$plotter->createHistogram($label, $begin, $end);}
    101138if ($nebulous && $timeSeries) {$plotter->plotStorageTimeSeries($begin, $end);}
Note: See TracChangeset for help on using the changeset viewer.