Changeset 29703
- Timestamp:
- Nov 8, 2010, 2:25:02 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/tools/czartool/Plotter.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czartool/Plotter.pm
r29686 r29703 4 4 use warnings; 5 5 use strict; 6 7 use File::Temp; 6 8 7 9 my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); … … 128 130 print GP ";\n"; 129 131 close GP; 132 133 # now delete temp dat files 134 foreach my $stage (keys %gnuplotFiles) {unlink($gnuplotFiles->{$stage});} 130 135 } 131 136 … … 207 212 my $outputFile = createImageFileName($self, $label, undef, "h", 0); 208 213 209 my $ inputFile = "/tmp/czarplot_gnuplot_".$label."_h.dat"; # TODO use stage not table210 open (GNUDAT, ">$inputFile");214 my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_gnuplot_".$label."_h.XXXXX", DIR => '/tmp', SUFFIX => '.dat'); 215 open (GNUDAT, ">".$tmpFile->filename); 211 216 212 217 my ($processed, $pending, $faults); … … 254 259 "set ylabel \"Exposures\";" . 255 260 "set boxwidth 0.75;" . 256 "plot ' $inputFile' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" .261 "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" . 257 262 "\n"; 258 263 259 264 close GP; 260 unlink($inputFile);261 265 } 262 266 … … 403 407 404 408 # now delete temp dat files 405 foreach my $stage (keys %$gnuplotFiles) { 406 407 unlink($gnuplotFiles->{$stage}); 408 } 409 foreach my $stage (keys %$gnuplotFiles) {unlink($gnuplotFiles->{$stage});} 409 410 } 410 411 … … 463 464 my $outputFile = "$prefix/czarplot_hosts_space.png"; 464 465 my $limit = 97.0; 465 my $inputFile = $self->{_czarDb}->createHostsData($limit); 466 my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_hosts_space.XXXXX", DIR => '/tmp', SUFFIX => '.dat'); 467 $self->{_czarDb}->createHostsData($limit, $tmpFile); 466 468 467 469 my $totalUsed = $self->{_czarDb}->getTotalClusterStorageAsPercentage(); … … 482 484 "set ylabel \"Space (TB)\";" . 483 485 "set xtic rotate by -90 scale 0;" . 484 "plot ' $inputFile' " .486 "plot '".$tmpFile->filename."' " . 485 487 "using 2:xtic(1) t \"Used\" lt 7," . 486 488 "'' using 3 t \"Over $limit% used\" lt 1," .
Note:
See TracChangeset
for help on using the changeset viewer.
