Changeset 29834 for branches/eam_branches/ipp-20101103/tools/czarplot.pl
- Timestamp:
- Nov 26, 2010, 10:33:29 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/tools/czarplot.pl
r29580 r29834 8 8 9 9 use czartool::CzarDb; 10 use czartool::Gpc1Db; 10 11 use czartool::Plotter; 12 use czartool::StageMetrics; 11 13 12 14 my $czarDbName = "czardb"; … … 14 16 my $stage = undef; 15 17 my $save_temps = undef; 16 my $ interval= undef;18 my $timeinpast = undef; 17 19 my $begin = undef; 18 20 my $end = undef; … … 23 25 my $timeSeries = undef; 24 26 my $rate = undef; 27 my $magicMask = undef; 28 my $rateInterval = undef; 25 29 my $deriv = undef; 26 30 my $showCleanup = undef; … … 28 32 my $savingToFile = undef; 29 33 my $analysis = undef; 34 my $exposureId = undef; 30 35 my $log = undef; 31 36 … … 34 39 "label|l=s" => \$label, 35 40 "stage|s=s" => \$stage, 36 "interval|i=s" => \$interval, 41 "timeinpast|p=s" => \$timeinpast, 42 "rateinterval|i=s" => \$rateInterval, 43 "exposureid|x=s" => \$exposureId, 44 "mask|m" => \$magicMask, 37 45 "begin|b=s" => \$begin, 38 46 "end|e=s" => \$end, … … 57 65 print "* UNKNKOWN: option @ARGV\n"; 58 66 } 67 if ($analysis && !$stage) { 68 $quit = 1; 69 print "* REQUIRED: choose a stage for analsis -s <chip|cam|warp|etc> (default=none)\n";} 59 70 if (!$histogram) { 60 71 print "* OPTIONAL: plot histogram -h (default=off)\n";} 61 72 if (!$timeSeries) { 62 73 print "* OPTIONAL: plot timeseries -t (default=on)\n";} 74 if (!$magicMask) { 75 print "* OPTIONAL: plot magic mask for these times -m (default=off)\n";} 76 if (!$exposureId) { 77 print "* OPTIONAL: set exposure ID for magic mask -x (default=none)\n";} 63 78 if (!$rate) { 64 print "* OPTIONAL: plot timeseries of rate-r (default=off)\n";}79 print "* OPTIONAL: plot histogram of rate -r (default=off)\n";} 65 80 if (!$deriv) { 66 81 $deriv = 0; … … 74 89 if (!$log) { 75 90 $log = 0; 76 print "* OPTIONAL: use log plots -g (default=$log \n";}91 print "* OPTIONAL: use log plots -g (default=$log)\n";} 77 92 if (!$nebulous) { 78 93 print "* OPTIONAL: plot nebulous disk space -n (default=off)\n";} … … 82 97 if (!$stage) { 83 98 print "* OPTIONAL: choose a stage -s <chip|cam|warp|etc> (default=none)\n";} 84 if (!$interval) { 85 print "* OPTIONAL: choose time interval in past -i <'1 hour'|'1 day'|etc> (default=none\n";} 99 if (!$timeinpast) { 100 print "* OPTIONAL: choose time interval in past -p <'1 hour'|'1 day'|etc> (default=none\n";} 101 if (!$rateInterval) { 102 print "* OPTIONAL: time interval for rate plot -i <'1 hour'|'1 day'|etc> (default=depends on time frame)\n";} 86 103 if (!$begin) { 87 104 print "* OPTIONAL: choose a begin time -b <datetime> (default=6:35am this morning)\n";} … … 98 115 99 116 # default values 100 if (!$ nebulous && !$histogram && !$timeSeries) {$timeSeries = 1; $histogram = 0;}117 if (!$rate && !$magicMask && !$nebulous && !$histogram && !$analysis && !$timeSeries) {$timeSeries = 1;} 101 118 if (!$verbose) {$verbose = 0;} 102 119 if (!$save_temps) {$save_temps = 0;} … … 104 121 else {$savingToFile = 1;} 105 122 123 my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser"); 106 124 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", $verbose, $save_temps); 107 125 $czarDb->setDateFormat("%Y%m%d-%H%i%s"); … … 109 127 110 128 my $plotter = new czartool::Plotter( 129 $gpc1Db, 111 130 $czarDb, 112 131 "%Y%m%d-%H%M%S", … … 121 140 $begin = "$day 06:35"; 122 141 $end = "$day 23:59"; 142 print "JKJKJK '$begin' '$end' \n"; 143 123 144 } 124 145 else { … … 127 148 if (!$begin) { 128 149 129 if ($ interval) {$begin = $czarDb->subtractInterval($end, $interval);}150 if ($timeinpast) {$begin = $czarDb->subtractInterval($end, $timeinpast);} 130 151 else {$begin = strftime('%Y-%m-%d 06:35',localtime);} 131 152 } … … 134 155 135 156 if ($rate) { 136 137 if (!$interval) {$interval = "1 HOUR";} 138 $plotter->createRateTimeSeries($label, $stage, $begin, $end, $interval, $log); 157 $plotter->createRateTimeSeries($label, $stage, $begin, $end, $rateInterval, $log); 139 158 exit; 140 159 } … … 143 162 if ($nebulous && $timeSeries) {$plotter->plotStorageTimeSeries($begin, $end);} 144 163 elsif ($nebulous) {$plotter->plotDiskUsageHistogram();} 164 if ($magicMask) { 165 166 if ($exposureId) {$plotter->plotMagicMaskFractionForThisExposure($exposureId);} 167 else {$plotter->plotMagicMaskFractionHistogram($begin, $end);} 145 168 169 } 146 170 147 171 if($analysis) { 148 172 149 my ($started, $finished, $stuck, $processed, $pending, $faults, $totalTime); 150 $czarDb->runAnalysis($label, $stage, $begin, $end, \$started, \$finished, \$stuck, \$processed, \$pending, \$faults, \$totalTime); 151 152 if (defined $started) {print "* Processing started at $started\n";} 153 if (defined $finished) {print "* Processing finished at $finished and took $totalTime\n";} 154 else {print "* Processing has not finished\n";} 155 if (defined $stuck) {print "* Processing has been stuck since $stuck\n";} 156 print "* $processed exposures have been processed, with $pending pending and $faults faults\n"; 157 158 print "*******************************************************************************\n"; 173 my $stageMetrics = new czartool::StageMetrics($stage, $label, $begin, $end); 174 if ($czarDb->runAnalysis($stageMetrics)) {$stageMetrics->printMe();} 159 175 }
Note:
See TracChangeset
for help on using the changeset viewer.
