Changeset 29515 for branches/eam_branches/ipp-20100823/tools/czarplot.pl
- Timestamp:
- Oct 21, 2010, 2:45:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/tools/czarplot.pl
r29124 r29515 17 17 my $begin = undef; 18 18 my $end = undef; 19 my $day = undef; 19 20 my $path = undef; 20 21 my $verbose = undef; 21 22 my $histogram = undef; 22 23 my $timeSeries = undef; 24 my $rate = undef; 25 my $deriv = undef; 26 my $showCleanup = undef; 23 27 my $nebulous = undef; 24 28 my $savingToFile = undef; … … 26 30 27 31 GetOptions ( 28 "dbname |d=s" => \$czarDbName,32 "dbname=s" => \$czarDbName, 29 33 "label|l=s" => \$label, 30 34 "stage|s=s" => \$stage, … … 32 36 "begin|b=s" => \$begin, 33 37 "end|e=s" => \$end, 38 "day|y=s" => \$day, 34 39 "output|o=s" => \$path, 35 40 "histogram|h" => \$histogram, 36 41 "nebulous|n" => \$nebulous, 42 "cleanup|c" => \$showCleanup, 43 "rate|r" => \$rate, 44 "deriv|d" => \$deriv, 37 45 "timeseries|t" => \$timeSeries, 38 46 "verbose|v" => \$verbose, … … 51 59 if (!$timeSeries) { 52 60 print "* OPTIONAL: plot timeseries -t (default=on)\n";} 61 if (!$rate) { 62 print "* OPTIONAL: plot timeseries of rate -r (default=off)\n";} 63 if (!$deriv) { 64 $deriv = 0; 65 print "* OPTIONAL: plot first derivative -d (default=$deriv)\n";} 66 if (!$showCleanup) { 67 $showCleanup = 0; 68 print "* OPTIONAL: include cleanup in timeseries -c (default=$showCleanup)\n";} 53 69 if (!$log) { 54 70 $log = 0; … … 64 80 print "* OPTIONAL: choose time interval in past -i <'1 hour'|'1 day'|etc> (default=none\n";} 65 81 if (!$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";} 67 83 if (!$end) { 68 84 print "* OPTIONAL: choose an end time -e <datetime> (default=now)\n";} 85 if (!$day) { 86 print "* OPTIONAL: choose a single day to plot -y <date> (default=today)\n";} 69 87 if (!$path) { 70 88 print "* OPTIONAL: choose an output location -o <path> (default=none)\n"; … … 85 103 86 104 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); 105 my $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); 89 111 90 112 # 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);} 113 if($day) { 114 115 # day plots should run from about 6:30am until midnight 116 $begin = "$day 06:35"; 117 $end = "$day 23:59"; 95 118 } 119 else { 96 120 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 } 97 128 my $diskUsage = 1; # TODO 98 129 99 if (!$nebulous && $timeSeries) {$plotter->createTimeSeries($label, $stage, $begin, $end, $log);} 130 if ($rate) { 131 132 if (!$interval) {$interval = "1 HOUR";} 133 $plotter->createRateTimeSeries($label, $stage, $begin, $end, $interval, $log); 134 exit; 135 } 136 if (!$nebulous && $timeSeries) {$plotter->createTimeSeries($label, $stage, $begin, $end, $log, $showCleanup, $deriv);} 100 137 if ($histogram) {$plotter->createHistogram($label, $begin, $end);} 101 138 if ($nebulous && $timeSeries) {$plotter->plotStorageTimeSeries($begin, $end);}
Note:
See TracChangeset
for help on using the changeset viewer.
