Changeset 34109
- Timestamp:
- Jun 29, 2012, 1:27:29 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/czartool/czartool/Plotter.pm (modified) (33 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czartool/Plotter.pm
r34096 r34109 11 11 12 12 my @allStages = ( 13 "chip", 14 "cam", 15 "fake", 16 "warp", 17 "stack", 18 "staticsky", 19 "diff", 20 "dist", 13 "chip", 14 "cam", 15 "fake", 16 "warp", 17 "stack", 18 "staticsky", 19 "diff", 20 "dist", 21 21 "pub", 22 22 "chipbackground"); 23 23 24 24 my @allIppToPspsStages = ( 25 "processed", 26 "loaded_to_datastore", 27 "loaded_to_ODM", 28 "merge_worthy", 29 "deleted_datastore", 30 "deleted_dxlayer", 31 "merged", 25 "processed", 26 "loaded_to_datastore", 27 "loaded_to_ODM", 28 "merge_worthy", 29 "deleted_datastore", 30 "deleted_dxlayer", 31 "merged", 32 32 "deleted_local"); 33 33 34 my $GNUPLOT="/home/panstarrs/ipp/local/bin/gnuplot"; 34 35 35 36 ########################################################################### … … 96 97 ########################################################################### 97 98 # 98 # Sets plotter to use standard IPP mode, i.e. chip, cam etc 99 # Sets plotter to use standard IPP mode, i.e. chip, cam etc 99 100 # 100 101 ########################################################################### … … 107 108 ########################################################################### 108 109 # 109 # Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc 110 # Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc 110 111 # 111 112 ########################################################################### … … 182 183 183 184 # stages 184 my $stages = undef; 185 my $stages = undef; 185 186 if (!$selectedStage) { 186 187 $stages = \@{$self->{allStages}}; … … 196 197 my $stage = undef; 197 198 my $gnuplotFile = undef; 198 my $minX = 999999999; 199 my $minX = 999999999; 199 200 my $maxX = -9999999999; 200 201 my $timeDiff = 0; … … 203 204 204 205 if ($self->{_czarDb}->createProcessingRateData( 205 $stage, 206 $label, 207 $beginTime, 208 $endTime, 206 $stage, 207 $label, 208 $beginTime, 209 $endTime, 209 210 $interval, 210 211 \$gnuplotFile, … … 233 234 my ($self, $gnuplotFiles, $outputFile, $label, $selectedStage, $beginTime, $endTime, $interval) = @_; 234 235 235 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";236 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 236 237 use FileHandle; 237 238 GP->autoflush(1); … … 276 277 my ($self, $label, $selectedStage, $beginTime, $endTime, $linear, $log, $rate) = @_; 277 278 278 my $minX = 999999999; 279 my $minX = 999999999; 279 280 my $maxX = -9999999999; 280 281 my $timeDiff = 0; 281 282 282 my $stages = undef; 283 my $stages = undef; 283 284 284 285 if (!$selectedStage) {$stages = \@{$self->{allStages}};} 285 else {$stages = ["$selectedStage"]}; 286 else {$stages = ["$selectedStage"]}; 286 287 287 288 my %linDataFiles; … … 296 297 297 298 if($self->{_czarDb}->createTimeSeriesData( 298 $label, 299 $stage, 300 $beginTime, 301 $endTime, 302 \$minX, 303 \$maxX, 304 \$timeDiff, 299 $label, 300 $stage, 301 $beginTime, 302 $endTime, 303 \$minX, 304 \$maxX, 305 \$timeDiff, 305 306 \$linDataFile, 306 307 \$logDataFile, … … 311 312 $ratDataFiles{$stage} = $ratDataFile; 312 313 } 313 } 314 } 314 315 315 316 my $numOfPlots = keys(%linDataFiles); … … 319 320 # print "Warning: No plots could be generated for stage '$selectedStage' and label '$label' during time period '$beginTime', '$endTime'\n"; 320 321 return; 321 } 322 } 322 323 323 324 if ($timeDiff == 0) { … … 332 333 333 334 $self->plotTimeSeries( 334 \%linDataFiles, 335 $outputFile, 336 $label, 337 $beginTime, 338 $endTime, 339 $maxX, 340 $minX, 341 $timeDiff, 335 \%linDataFiles, 336 $outputFile, 337 $label, 338 $beginTime, 339 $endTime, 340 $maxX, 341 $minX, 342 $timeDiff, 342 343 "", 343 344 "Items"); … … 349 350 350 351 $self->plotTimeSeries( 351 \%logDataFiles, 352 $outputFile, 353 $label, 354 $beginTime, 355 $endTime, 356 $maxX, 357 $minX, 358 $timeDiff, 352 \%logDataFiles, 353 $outputFile, 354 $label, 355 $beginTime, 356 $endTime, 357 $maxX, 358 $minX, 359 $timeDiff, 359 360 "", 360 361 "Log(Items)"); … … 366 367 367 368 $self->plotTimeSeries( 368 \%ratDataFiles, 369 $outputFile, 370 $label, 371 $beginTime, 372 $endTime, 373 $maxX, 374 $minX, 375 $timeDiff, 369 \%ratDataFiles, 370 $outputFile, 371 $label, 372 $beginTime, 373 $endTime, 374 $maxX, 375 $minX, 376 $timeDiff, 376 377 "", 377 378 "Items per hour"); 378 } 379 } 379 } 380 } 380 381 381 382 ########################################################################### … … 398 399 399 400 if (!$self->{_czarDb}->countProcessedPendingAndFaults( 400 $label, 401 $stage, 402 $beginTime, 403 $endTime, 404 \$processed, 405 \$pending, 401 $label, 402 $stage, 403 $beginTime, 404 $endTime, 405 \$processed, 406 \$pending, 406 407 \$faults)) {next;} 407 408 408 $pendingMinusFaults = $pending - $faults; 409 $pendingMinusFaults = $pending - $faults; 409 410 print GNUDAT "$stage $faults $processed $pendingMinusFaults\n"; 410 411 } … … 412 413 close(GNUDAT); 413 414 414 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";415 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 415 416 use FileHandle; 416 417 GP->autoflush(1); … … 427 428 "set ylabel \"Items\";" . 428 429 "set boxwidth 0.75;" . 429 "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" . 430 "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" . 430 431 "\n"; 431 432 … … 435 436 ########################################################################### 436 437 # 437 # Sets the output path 438 # Sets the output path 438 439 # 439 440 ########################################################################### … … 441 442 my ($self, $outputFormat) = @_; 442 443 $self->{_outputFormat} = $outputFormat if defined($outputFormat); 443 } 444 445 ########################################################################### 446 # 447 # Sets the output type 444 } 445 446 ########################################################################### 447 # 448 # Sets the output type 448 449 # 449 450 ########################################################################### … … 451 452 my ($self, $outputPath) = @_; 452 453 $self->{_outputPath} = $outputPath if defined($outputPath); 453 } 454 } 454 455 455 456 ########################################################################### … … 462 463 $self->{_dateFormat} = $dateFormat if defined($dateFormat); 463 464 return $self->{_dateFormat}; 464 } 465 } 465 466 466 467 ########################################################################### … … 543 544 $title .= " for '$label'\\nFrom '$fromTime' to '$toTime' HST"; 544 545 545 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";546 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 546 547 use FileHandle; 547 548 GP->autoflush(1); … … 612 613 $self->getTimeSpacing($timeDiff, \$divX, \$timeFormat); 613 614 614 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";615 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 615 616 use FileHandle; 616 617 GP->autoflush(1); … … 656 657 my $totalPercent = sprintf("%.1f%%", $totalUsed); 657 658 658 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";659 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 659 660 use FileHandle; 660 661 GP->autoflush(1); … … 672 673 "plot '".$tmpFile->filename."' " . 673 674 "using 2:xtic(1) t \"Used\" lt 7," . 674 "'' using 3 t \"Over $limit% used\" lt 1," . 675 "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," . 676 "'' using 5 t \"Free\" lt 2," . 677 "'' using 6 notitle fs solid 0.50 lt -1" . 675 "'' using 3 t \"Over $limit% used\" lt 1," . 676 "'' using 4 t \"Unavailable\" fs solid 0.50 lt -1 ," . 677 "'' using 5 t \"Free\" lt 2," . 678 "'' using 6 notitle fs solid 0.50 lt -1" . 678 679 ";" . 679 680 … … 718 719 719 720 720 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";721 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 721 722 use FileHandle; 722 723 GP->autoflush(1); … … 731 732 set grid 732 733 set size square 733 set xrange [-0.5:7.5] reverse 734 set yrange [-0.5:7.5] 734 set xrange [-0.5:7.5] reverse 735 set yrange [-0.5:7.5] 735 736 unset key 736 737 set palette rgb 22,13,10 … … 769 770 770 771 # set up bins 771 my %histogram; 772 my %histogram; 772 773 my @bins; 773 774 my $interval = 0.05; … … 812 813 813 814 my $totalMaskFrac; 814 815 815 816 if ($totalChipCount > 0) { 816 817 … … 842 843 843 844 # make histogram 844 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";845 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 845 846 use FileHandle; 846 847 GP->autoflush(1); … … 859 860 "set boxwidth 0.75;" . 860 861 "set xtic rotate by -90 scale 0;" . 861 "plot '".$tmpFile->filename."' using 2:xtic(1) notitle lt 1;" . 862 "plot '".$tmpFile->filename."' using 2:xtic(1) notitle lt 1;" . 862 863 "\n"; 863 864 … … 865 866 866 867 # make cumulative distribution 867 open (GP, "| /usr/bin/gnuplot-persist") or die "no gnuplot";868 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 868 869 use FileHandle; 869 870 GP->autoflush(1); … … 878 879 "set ylabel \"Number of Exposures\";" . 879 880 "set xtic rotate by -90 scale 0;" . 880 "plot " . 881 "plot " . 881 882 "'".$tmpFile->filename."' using 1:3 notitle with lines lt 2 lw 2\n"; 882 883
Note:
See TracChangeset
for help on using the changeset viewer.
