Changeset 34249
- Timestamp:
- Jul 31, 2012, 2:20:53 PM (14 years ago)
- Location:
- trunk/ippMonitor
- Files:
-
- 5 edited
-
czartool/czarplot.pl (modified) (7 diffs)
-
czartool/czarpoll.pl (modified) (10 diffs)
-
czartool/czartool/Plotter.pm (modified) (1 diff)
-
raw/czartool_getplot.php (modified) (1 diff)
-
raw/czartool_labels.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/czartool/czarplot.pl
r32796 r34249 61 61 print "* OPTIONAL: plot histogram -h (default=off)\n";} 62 62 if (!$timeSeries) { 63 print "* OPTIONAL: plot timeseries -t (default=on)\n";} 63 print "* OPTIONAL: plot timeseries -t (default=on)\n";} 64 64 if (!$magicMask) { 65 print "* OPTIONAL: plot magic mask for these times -m (default=off)\n";} 65 print "* OPTIONAL: plot magic mask for these times -m (default=off)\n";} 66 66 if (!$exposureId) { 67 print "* OPTIONAL: set exposure ID for magic mask -x (default=none)\n";} 67 print "* OPTIONAL: set exposure ID for magic mask -x (default=none)\n";} 68 68 if (!$rate) { 69 print "* OPTIONAL: plot histogram of rate -r (default=off)\n";} 69 print "* OPTIONAL: plot histogram of rate -r (default=off)\n";} 70 70 if (!$log) { 71 71 $log = 0; 72 72 print "* OPTIONAL: use log plots -g (default=$log)\n";} 73 73 if (!$nebulous) { 74 print "* OPTIONAL: plot nebulous disk space -n (default=off)\n";} 74 print "* OPTIONAL: plot nebulous disk space -n (default=off)\n";} 75 75 if (!$label) { 76 76 $label = "all_stdscience_labels"; … … 79 79 print "* OPTIONAL: choose a stage -s <chip|cam|warp|etc> (default=none)\n";} 80 80 if (!$timeinpast) { 81 print "* OPTIONAL: choose time interval in past -p <'1 hour'|'1 day'|etc> (default=none\n";} 81 print "* OPTIONAL: choose time interval in past -p <'1 hour'|'1 day'|etc> (default=none\n";} 82 82 if (!$rateInterval) { 83 print "* OPTIONAL: time interval for rate plot -i <'1 hour'|'1 day'|etc> (default=depends on time frame)\n";} 83 print "* OPTIONAL: time interval for rate plot -i <'1 hour'|'1 day'|etc> (default=depends on time frame)\n";} 84 84 if (!$begin) { 85 print "* OPTIONAL: choose a begin time -b <datetime> (default=18:00)\n";} 85 print "* OPTIONAL: choose a begin time -b <datetime> (default=18:00)\n";} 86 86 if (!$end) { 87 print "* OPTIONAL: choose an end time -e <datetime> (default=now)\n";} 87 print "* OPTIONAL: choose an end time -e <datetime> (default=now)\n";} 88 88 if (!$day) { 89 print "* OPTIONAL: choose a single day to plot -d <date> (default=today)\n";} 89 print "* OPTIONAL: choose a single day to plot -d <date> (default=today)\n";} 90 90 if (!$path) { 91 91 print "* OPTIONAL: choose an output location -o <path> (default=none)\n"; 92 } 92 } 93 93 if (!$psps) { 94 print "* OPTIONAL: plot ippToPsps stages -u (default=off)\n";} 94 print "* OPTIONAL: plot ippToPsps stages -u (default=off)\n";} 95 95 print "*\n*******************************************************************************\n"; 96 96 … … 110 110 my $newDayTime = $config->getMetricsStartTime(); 111 111 112 my $plotter = undef; 112 my $plotter = undef; 113 113 if ($savingToFile) { 114 114 … … 122 122 if ($psps) {$plotter->setIppToPspsMode();} 123 123 124 # if a single day has been chosen 124 # if a single day has been chosen 125 125 if($day) { 126 126 … … 134 134 # plots should span 24 housr from previous day 135 135 my $dayBefore = $czarDb->subtractInterval($day, "1 DAY"); 136 136 137 137 $begin = "$dayBefore $newDayTime"; 138 138 $end = "$day $newDayTime"; … … 147 147 my $yesterday = $czarDb->subtractInterval($today, "1 DAY"); 148 148 149 149 150 150 if ($timeinpast) {$begin = $czarDb->subtractInterval($end, $timeinpast);} 151 151 elsif ($czarDb->isBefore($end, "$today $newDayTime")) {$begin = "$yesterday $newDayTime";} … … 166 166 167 167 if ($histogram) {$plotter->createHistogram($label, $begin, $end);} 168 if ($nebulous && $timeSeries) {$plotter->plotStorageTimeSeries($begin, $end);} 169 elsif ($nebulous) {$plotter->plotDiskUsageHistogram();} 168 if ($nebulous && $timeSeries) { 169 $plotter->plotStorageTimeSeries($begin, $end); 170 } 171 elsif ($nebulous) { 172 $plotter->plotDiskUsageHistogram(); 173 $plotter->plotDiskUsageHistogramLarge(); 174 } 170 175 if ($magicMask) { 171 176 -
trunk/ippMonitor/czartool/czarpoll.pl
r33814 r34249 30 30 31 31 my $config = new czartool::Config(); 32 my $czarDb = $config->getCzarDbInstance(); 32 my $czarDb = $config->getCzarDbInstance(); 33 33 my $gpc1Db = $config->getGpc1Instance; 34 34 my $nebulous = new czartool::Nebulous($czarDb); 35 35 my $pantasks = new czartool::Pantasks(); 36 my $plotter = czartool::Plotter->new_file($config, $config->getGnuplotPath(), $save_temps); 36 my $plotter = czartool::Plotter->new_file($config, $config->getGnuplotPath(), $save_temps); 37 37 38 38 39 39 my @stages = ( 40 "chip", 41 "cam", 42 "fake", 43 "warp", 44 "stack", 45 "staticsky", 46 "diff", 47 "dist", 40 "chip", 41 "cam", 42 "fake", 43 "warp", 44 "stack", 45 "staticsky", 46 "diff", 47 "dist", 48 48 "pub", 49 49 "chipbackground"); … … 65 65 ########################################################################### 66 66 # 67 # Updates the dates from pantasks for all interested servers 67 # Updates the dates from pantasks for all interested servers 68 68 # 69 69 ########################################################################### … … 78 78 79 79 my @dates = @{$pantasks->getDates($server)}; 80 if (@dates) { 80 if (@dates) { 81 81 82 82 $czarDb->updateServerDates($server, \@dates); … … 91 91 ########################################################################### 92 92 # 93 # Updates the labels from pantasks for all interested servers 93 # Updates the labels from pantasks for all interested servers 94 94 # 95 95 ########################################################################### … … 103 103 104 104 my @labels = @{$pantasks->getLabels($server)}; 105 if (@labels) { 105 if (@labels) { 106 106 107 107 $czarDb->updateCurrentLabels($server, \@labels); … … 116 116 ########################################################################### 117 117 # 118 # Updates pantasks server status TODO should really get info for all servers at once 118 # Updates pantasks server status TODO should really get info for all servers at once 119 119 # 120 120 ########################################################################### … … 136 136 ########################################################################### 137 137 # 138 # Polls with provided period (seconds) 138 # Polls with provided period (seconds) 139 139 # 140 140 ########################################################################### … … 184 184 # create metrics for last 24 hours 185 185 print "* Creating metrics for last 24 hours\n"; 186 my $dayMetrics = new czartool::DayMetrics($config, 1, 0, $today); 186 my $dayMetrics = new czartool::DayMetrics($config, 1, 0, $today); 187 187 $dayMetrics->writeHTML(); 188 188 189 189 # now update metrics index page 190 my $metricsIndex = new czartool::MetricsIndex($config, 1, 0); 190 my $metricsIndex = new czartool::MetricsIndex($config, 1, 0); 191 191 $metricsIndex->writeHTML(); 192 192 … … 210 210 $plotter->plotStorageTimeSeries($czarDb->subtractInterval($begin, "1 WEEK") , $end); 211 211 $plotter->plotDiskUsageHistogram(); 212 $plotter->plotDiskUsageHistogramLarge(); 212 213 updateServerStatus(); 213 214 … … 269 270 $czarDb->getCurrentIppToPspsLabels($begin, $end, \$ippToPspsLabels); 270 271 $plotter->setIppToPspsMode(); 271 272 272 273 # create ippToPsps labels 273 274 foreach $stage (@ippToPspsStages) { 274 275 foreach $row ( @{$ippToPspsLabels} ) { 275 276 my ($label) = @{$row}; 276 277 277 278 chomp($label); 278 279 $plotter->createTimeSeries($label, $stage, $begin, $end, 1, 0, 1); -
trunk/ippMonitor/czartool/czartool/Plotter.pm
r34109 r34249 666 666 "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" . 667 667 "set style fill solid 1.00 border -1;" . 668 "set key center top;" . 669 "set style histogram rowstacked;" . 670 "set style data histograms;" . 671 "set ylabel \"Space (TB)\";" . 672 "set xtic rotate by -90 scale 0;" . 673 "plot '".$tmpFile->filename."' " . 674 "using 2:xtic(1) t \"Used\" lt 7," . 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" . 679 ";" . 680 681 "\n"; 682 close GP; 683 } 684 685 ########################################################################### 686 # 687 # Plots disk usage across cluster as a stacked histogram 688 # 689 ########################################################################### 690 sub plotDiskUsageHistogramLarge { 691 my ($self) = @_; 692 693 my $prefix = $self->{_outputPath} ? $self->{_outputPath} : "."; # TODO should be function for this 694 my $outputFile = "$prefix/czarplot_hosts_space_large.png"; 695 my $limit = 97.0; 696 my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_hosts_space.XXXXX", DIR => '/tmp', SUFFIX => 'dat'); 697 $self->{_czarDb}->createHostsData($limit, $tmpFile); 698 699 my $totalUsed = $self->{_czarDb}->getTotalClusterStorageAsPercentage(); 700 701 my $totalPercent = sprintf("%.1f%%", $totalUsed); 702 703 open (GP, "|$GNUPLOT -persist") or die "no gnuplot"; 704 use FileHandle; 705 GP->autoflush(1); 706 707 if ($self->{_outputFormat} ne "X11") {print GP "set output \"$outputFile\";";} 708 print GP 709 "set term $self->{_outputFormat} size 1280,1024;" . 710 "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" . 711 "set style fill solid 1.00 border -1;" . 712 "set bmarg 5; " . 668 713 "set key center top;" . 669 714 "set style histogram rowstacked;" . -
trunk/ippMonitor/raw/czartool_getplot.php
r33441 r34249 28 28 else if ($type=="s") 29 29 $filePath = "$path/czarplot_hosts_space.png"; 30 else if ($type=="sl") 31 $filePath = "$path/czarplot_hosts_space_large.png"; 30 32 else if ($type=="st") 31 33 $filePath = "$path/czarplot_cluster.png"; -
trunk/ippMonitor/raw/czartool_labels.php
r34184 r34249 141 141 # storage plot 142 142 echo "<br>"; 143 echo "< img src=\"czartool_getplot.php?type=s\"><br>";143 echo "<a href=\"czartool_getplot.php?type=sl\"><img title=\"Click to enlarge me\" src=\"czartool_getplot.php?type=s\"></a><br>"; 144 144 # storage timeseries 145 145 echo "<br>";
Note:
See TracChangeset
for help on using the changeset viewer.
