Changeset 29119
- Timestamp:
- Sep 3, 2010, 3:55:23 PM (16 years ago)
- Location:
- trunk/tools
- Files:
-
- 4 edited
-
czarplot.pl (modified) (3 diffs)
-
czartool/CzarDb.pm (modified) (3 diffs)
-
czartool/Plotter.pm (modified) (1 diff)
-
roboczar.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czarplot.pl
r29114 r29119 8 8 9 9 use czartool::CzarDb; 10 use czartool:: Czarplot;10 use czartool::Plotter; 11 11 12 12 my $czarDbName = "czardb"; … … 85 85 86 86 87 # GENE PLOTS my $ czarplot = new czartool::Czarplot($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 $ czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", $savingToFile ? "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8" : "X11", $path, $save_temps);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); 89 89 90 90 # sort out times … … 92 92 if (!$begin) { 93 93 if ($interval) {$begin = $czarDb->subtractInterval($end, $interval);} 94 else {$begin = strftime('%Y-%m-%d 06:3 0',localtime);}94 else {$begin = strftime('%Y-%m-%d 06:35',localtime);} 95 95 } 96 96 97 97 my $diskUsage = 1; # TODO 98 98 99 if (!$nebulous && $timeSeries) {$ czarplot->createTimeSeries($label, $stage, $begin, $end, !$log, $log);}100 if ($histogram) {$ czarplot->createHistogram($label, $begin, $end);}101 if ($nebulous && $timeSeries) {$ czarplot->plotStorageTimeSeries($begin, $end);}102 elsif ($nebulous) {$ czarplot->plotDiskUsageHistogram();}99 if (!$nebulous && $timeSeries) {$plotter->createTimeSeries($label, $stage, $begin, $end, $log);} 100 if ($histogram) {$plotter->createHistogram($label, $begin, $end);} 101 if ($nebulous && $timeSeries) {$plotter->plotStorageTimeSeries($begin, $end);} 102 elsif ($nebulous) {$plotter->plotDiskUsageHistogram();} 103 103 -
trunk/tools/czartool/CzarDb.pm
r29114 r29119 242 242 ########################################################################### 243 243 sub createTimeSeriesData { 244 my ($self, $label, $stage, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff, $dataFileLin, $dataFileLog) = @_; 245 246 ${$dataFileLin} = "/tmp/czarplot_gnuplot_lin_".$label."_".$stage."_t.dat"; 247 ${$dataFileLog} = "/tmp/czarplot_gnuplot_log_".$label."_".$stage."_t.dat"; 248 open (GNUDATLIN, ">${$dataFileLin}"); 249 open (GNUDATLOG, ">${$dataFileLog}"); 244 my ($self, $label, $stage, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff, $dataFile, $isLog) = @_; 245 246 ${$dataFile} = "/tmp/czarplot_gnuplot_".$label."_".$stage."_t.dat"; 247 248 open (GNUDAT, ">${$dataFile}") or print "* Problem opening gnuplot data file for plot for '$label' '$stage'\n"; 250 249 251 250 my $query = $self->{_db}->prepare(<<SQL); … … 264 263 265 264 my $minProcessed = undef; 266 267 ($minProcessed, ${$maxY}, ${$minY}, ${$maxX}, ${$minX}, ${$timeDiff}) = $query->fetchrow_array(); 265 my ($_maxY, $_minY, $_timeDiff); 266 ($minProcessed, $_maxY, $_minY, ${$maxX}, ${$minX}, $_timeDiff) = $query->fetchrow_array(); 267 268 if ($_maxY > ${$maxY}) {${$maxY} = $_maxY;} 269 if ($_minY < ${$minY}) {${$minY} = $_minY;} 270 if ($_timeDiff > ${$timeDiff}) {${$timeDiff} = $timeDiff;} 268 271 269 272 if (!defined $minProcessed) {return 0;} … … 284 287 my ($timestamp, $pending, $faults, $processed) = @row; 285 288 286 my $processedLog = log($processed + 1);287 my $pendingLog = log($pending + 1); 288 my $faultsLog = log($faults+ 1);289 290 # print "'$timestamp' '$pending' '$faults' '$processed'\n";291 print GNUDATLIN "$timestamp $pending $faults $processed\n";292 print GNUDATLOG "$timestamp $pendingLog $faultsLog $processedLog\n"; 293 }294 295 close(GNUDATLIN); 296 close(GNUDAT LOG);289 if ($isLog) { 290 291 $processed = log($processed + 1); 292 $pending = log($pending + 1); 293 $faults = log($faults + 1); 294 } 295 296 print GNUDAT "$timestamp $pending $faults $processed\n"; 297 } 298 299 close(GNUDAT) or print "* Problem closing gnuplot data file for plot for '$label' '$stage'\n"; 297 300 298 301 return 1; -
trunk/tools/czartool/Plotter.pm
r29118 r29119 288 288 # when plotting multiple stages, show only processed 289 289 else { 290 290 291 print GP "'" . $gnuplotFiles->{$stage} . "' using 1:4 title \"$stage\" with lines lw 2"; 291 292 } -
trunk/tools/roboczar.pl
r29114 r29119 11 11 use czartool::Pantasks; 12 12 use czartool::Nebulous; 13 use czartool:: Czarplot;13 use czartool::Plotter; 14 14 use czartool::Burntool; 15 15 … … 27 27 my $nebulous = new czartool::Nebulous($czarDb); 28 28 my $pantasks = new czartool::Pantasks(); 29 my $ czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8", "/tmp", $save_temps); # TODO hardcoded font path29 my $plotter = new czartool::Plotter($czarDb, "%Y%m%d-%H%M%S", "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8", "/tmp", $save_temps); # TODO hardcoded font path 30 30 my $burntool = new czartool::Burntool(); 31 31 … … 109 109 110 110 # sort out times 111 $begin = strftime('%Y-%m-%d 06:3 0',localtime);111 $begin = strftime('%Y-%m-%d 06:35',localtime); 112 112 $end = $czarDb->getNowTimestamp(); 113 113 … … 125 125 print "* Checking Nebulous\n"; 126 126 $nebulous->updateClusterSpaceInfo(); 127 $ czarplot->plotDiskUsageHistogram();127 $plotter->plotDiskUsageHistogram(); 128 128 updateServerStatus(); 129 129 … … 186 186 187 187 chomp($label); 188 $ czarplot->createTimeSeries($label, $stage, $begin, $end, 1, 1);188 $plotter->createLogAndLinearTimeSeries($label, $stage, $begin, $end); 189 189 } 190 190 } … … 194 194 my ($label) = @{$row}; 195 195 196 $ czarplot->createTimeSeries($label, undef, $begin, $end, 1, 1);197 $ czarplot->createHistogram($label, $begin, $end);196 $plotter->createLogAndLinearTimeSeries($label, undef, $begin, $end); 197 $plotter->createHistogram($label, $begin, $end); 198 198 199 199 #routineChecks($label, "1 HOUR"); 200 200 } 201 $ czarplot->createTimeSeries("all_".$server."_labels", undef, $begin, $end, 1, 1);202 $ czarplot->createHistogram("all_".$server."_labels", $begin, $end);201 $plotter->createLogAndLinearTimeSeries("all_".$server."_labels", undef, $begin, $end); 202 $plotter->createHistogram("all_".$server."_labels", $begin, $end); 203 203 foreach $stage (@stages) { 204 204 205 $ czarplot->createTimeSeries("all_".$server."_labels", $stage, $begin, $end, 1, 1); # TODO must be a neater way...205 $plotter->createLogAndLinearTimeSeries("all_".$server."_labels", $stage, $begin, $end); # TODO must be a neater way... 206 206 } 207 207 }
Note:
See TracChangeset
for help on using the changeset viewer.
