Index: branches/eam_branches/ipp-20100823/tools/czarplot.pl
===================================================================
--- branches/eam_branches/ipp-20100823/tools/czarplot.pl	(revision 29124)
+++ branches/eam_branches/ipp-20100823/tools/czarplot.pl	(revision 29515)
@@ -17,8 +17,12 @@
 my $begin = undef;
 my $end = undef;
+my $day = undef;
 my $path = undef;
 my $verbose = undef;
 my $histogram = undef;
 my $timeSeries = undef;
+my $rate = undef;
+my $deriv = undef;
+my $showCleanup = undef;
 my $nebulous = undef;
 my $savingToFile = undef;
@@ -26,5 +30,5 @@
 
 GetOptions (
-        "dbname|d=s" => \$czarDbName,
+        "dbname=s" => \$czarDbName,
         "label|l=s" => \$label,
         "stage|s=s" => \$stage,
@@ -32,7 +36,11 @@
         "begin|b=s" => \$begin,
         "end|e=s" => \$end,
+        "day|y=s" => \$day,
         "output|o=s" => \$path,
         "histogram|h" => \$histogram,
         "nebulous|n" => \$nebulous,
+        "cleanup|c" => \$showCleanup,
+        "rate|r" => \$rate,
+        "deriv|d" => \$deriv,
         "timeseries|t" => \$timeSeries,
         "verbose|v" => \$verbose,
@@ -51,4 +59,12 @@
 if (!$timeSeries) {
     print "* OPTIONAL: plot timeseries                 -t                          (default=on)\n";} 
+if (!$rate) {
+    print "* OPTIONAL: plot timeseries of rate         -r                          (default=off)\n";} 
+if (!$deriv) {
+    $deriv = 0;
+    print "* OPTIONAL: plot first derivative           -d                          (default=$deriv)\n";} 
+if (!$showCleanup) {
+    $showCleanup = 0;
+    print "* OPTIONAL: include cleanup in timeseries   -c                          (default=$showCleanup)\n";} 
 if (!$log) {
     $log = 0;
@@ -64,7 +80,9 @@
     print "* OPTIONAL: choose time interval in past    -i <'1 hour'|'1 day'|etc>   (default=none\n";} 
 if (!$begin) {
-    print "* OPTIONAL: choose a begin time             -b <datetime>               (default=7am this morning)\n";} 
+    print "* OPTIONAL: choose a begin time             -b <datetime>               (default=6:35am this morning)\n";} 
 if (!$end) {
     print "* OPTIONAL: choose an end time              -e <datetime>               (default=now)\n";} 
+if (!$day) {
+    print "* OPTIONAL: choose a single day to plot     -y <date>                   (default=today)\n";} 
 if (!$path) {
     print "* OPTIONAL: choose an output location       -o <path>                   (default=none)\n";
@@ -85,17 +103,36 @@
 
 
-# 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);
-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);
+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);
 
 # sort out times
-if (!$end) {$end = $czarDb->getNowTimestamp();}
-if (!$begin) {
-    if ($interval) {$begin = $czarDb->subtractInterval($end, $interval);}
-    else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
+if($day) {
+
+    # day plots should run from about 6:30am until midnight
+    $begin =  "$day 06:35";
+    $end = "$day 23:59";
 }
+else {
 
+    if (!$end) {$end = $czarDb->getNowTimestamp();}
+    if (!$begin) {
+
+        if ($interval) {$begin = $czarDb->subtractInterval($end, $interval);}
+        else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
+    }
+}
 my $diskUsage = 1; # TODO
 
-if (!$nebulous && $timeSeries) {$plotter->createTimeSeries($label, $stage, $begin, $end, $log);}
+if ($rate) {
+
+    if (!$interval) {$interval = "1 HOUR";}
+    $plotter->createRateTimeSeries($label, $stage, $begin, $end, $interval, $log);
+    exit;
+}
+if (!$nebulous && $timeSeries) {$plotter->createTimeSeries($label, $stage, $begin, $end, $log, $showCleanup, $deriv);}
 if ($histogram) {$plotter->createHistogram($label, $begin, $end);}
 if ($nebulous && $timeSeries) {$plotter->plotStorageTimeSeries($begin, $end);}
