Changeset 28707
- Timestamp:
- Jul 23, 2010, 3:55:02 PM (16 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
-
czarplot.pl (modified) (9 diffs)
-
roboczar.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czarplot.pl
r28704 r28707 17 17 my $save_temps = undef; 18 18 my $interval = undef; 19 my $begin = undef; 20 my $end = undef; 19 21 my $verbose = undef; 20 22 my $histogram = undef; … … 26 28 "stage|s=s" => \$stage, 27 29 "interval|i=s" => \$interval, 30 "begin|b=s" => \$begin, 31 "end|e=s" => \$end, 28 32 "histogram|h" => \$histogram, 29 33 "timeseries|t" => \$timeSeries, … … 48 52 print "* OPTIONAL: choose an interval -i <'1 hour'|'1 day'|etc> (default=interval since 7am this morning)\n"; 49 53 } 54 if (!$begin) { 55 print "* OPTIONAL: choose a begin time -d <datetime> (default=7am this morning)\n"; 56 } 57 if (!$end) { 58 print "* OPTIONAL: choose an end time -e <datetime> (default=now)\n"; 59 } 50 60 51 61 print "\n"; … … 63 73 my @allStages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); 64 74 65 my $toTime = $czarDb->getNowTimestamp(); 66 my $fromTime = undef; 75 # sort out times 76 if (!$end) {$end = $czarDb->getNowTimestamp();} 77 if (!$begin) { 78 if ($interval) {$begin = $czarDb->getIntervalInPast($interval);} 79 else {$begin = strftime('%Y-%m-%d 07:00',localtime);} 80 } 67 81 68 if ($interval) {$fromTime = $czarDb->getIntervalInPast($interval);} 69 else {$fromTime = strftime('%Y-%m-%d 07:00',localtime);} 70 71 if ($histogram) {plotHistogram($label, $fromTime, $toTime);} 72 if ($timeSeries) {plotTimeSeries($label, $stage, $fromTime, $toTime); } 82 if ($histogram) {plotHistogram($label, $begin, $end);} 83 if ($timeSeries) {plotTimeSeries($label, $stage, $begin, $end); } 73 84 74 85 ########################################################################### … … 78 89 ########################################################################### 79 90 sub plotTimeSeries { 80 my ($label, $selectedStage, $ fromTime, $toTime) = @_;91 my ($label, $selectedStage, $beginTime, $endTime) = @_; 81 92 82 93 my ($minX, $maxX, $minY, $maxY, $timeDiff); … … 93 104 my %gnuplotFiles; 94 105 foreach $stage (@{$stages}) { 95 $gnuplotFiles{$stage} = $czarDb->createTimeSeriesData($save_temps, $label, $stage, $ fromTime, $toTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);106 $gnuplotFiles{$stage} = $czarDb->createTimeSeriesData($save_temps, $label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff); 96 107 } 97 108 98 if (!$selectedStage) {$gnuplot->plotAllStagesTimeSeries($label, $ fromTime, $toTime, $maxX, $minX, $maxY, $minY, $timeDiff, \%gnuplotFiles);}99 else {$gnuplot->plotSingleTimeSeries($gnuplotFiles{$selectedStage}, $selectedStage, $label, $ fromTime, $toTime, $maxX, $minX, $maxY, $minY, $timeDiff);}109 if (!$selectedStage) {$gnuplot->plotAllStagesTimeSeries($label, $beginTime, $endTime, $maxX, $minX, $maxY, $minY, $timeDiff, \%gnuplotFiles);} 110 else {$gnuplot->plotSingleTimeSeries($gnuplotFiles{$selectedStage}, $selectedStage, $label, $beginTime, $endTime, $maxX, $minX, $maxY, $minY, $timeDiff);} 100 111 101 112 } … … 107 118 ########################################################################### 108 119 sub plotHistogram { 109 my ($label, $ fromTime, $toTime) = @_;120 my ($label, $beginTime, $endTime) = @_; 110 121 111 122 my ($tempFile, $filePath) = tempfile( "/tmp/czartool_gnuplot_histogram.XXXX", UNLINK => !$save_temps); … … 114 125 foreach $stage (@allStages) { 115 126 116 $czarDb->countProcessedPendingAndFaults($label, $stage, $ fromTime, $toTime, \$processed, \$pending, \$faults);127 $czarDb->countProcessedPendingAndFaults($label, $stage, $beginTime, $endTime, \$processed, \$pending, \$faults); 117 128 print $tempFile "$stage $processed, $pending, $faults\n"; 118 129 } … … 120 131 close($tempFile); 121 132 122 $gnuplot->plotHistogram($filePath, $label, $ fromTime, $toTime);133 $gnuplot->plotHistogram($filePath, $label, $beginTime, $endTime); 123 134 } 124 135 -
trunk/tools/roboczar.pl
r28704 r28707 47 47 } 48 48 49 50 49 ########################################################################### 51 50 # … … 54 53 ########################################################################### 55 54 sub updateServerStatus { 56 print "* Checking Servers\n";55 print "* Checking all pantasks servers\n"; 57 56 58 57 my $servers = $pantasks->getServerList(); … … 104 103 if ($str =~ m/on/) {$reverting = 1;} 105 104 else {$reverting = 0;} 106 print "* Storing for stage $stage\n";105 print "* Checking labels for $stage stage\n"; 107 106 108 107 foreach $row ( @{$rows} ) { … … 178 177 } 179 178 180 181 179 ########################################################################### 182 180 # … … 195 193 close(MAIL); 196 194 } 197 198
Note:
See TracChangeset
for help on using the changeset viewer.
