Changeset 29868
- Timestamp:
- Nov 26, 2010, 3:28:00 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/tools/czarmetrics.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czarmetrics.pl
r29803 r29868 9 9 10 10 use czartool::DayMetrics; 11 use czartool::MultiDayMetrics; 12 use czartool::MetricsIndex; 11 13 use czartool::CzarDb; 12 14 use czartool::Gpc1Db; … … 16 18 my $begin = undef; 17 19 my $end = undef; 20 my $cumulative = undef; 21 my $index = undef; 18 22 my $verbose = undef; 19 23 my $save_temps = undef; … … 23 27 "begin|b=s" => \$begin, 24 28 "end|e=s" => \$end, 25 "day|y=s" => \$day, 29 "day|d=s" => \$day, 30 "index|i" => \$index, 31 "cumulative|c" => \$cumulative, 26 32 "verbose|v" => \$verbose, 27 33 ); … … 35 41 } 36 42 if (!$day) { 37 print "* OPTIONAL: choose a single day -y<date> (default=today)\n";43 print "* OPTIONAL: choose a single day -d <date> (default=today)\n"; 38 44 } 39 if (!$begin) { 40 print "* OPTIONAL: choose a begin date -b <date> (default=today)\n";} 41 if (!$end) 42 { 43 print "* OPTIONAL: choose an end date -e <date> (default=today)\n"; 45 if (!$begin) { 46 print "* OPTIONAL: choose a begin date -b <date> (default=today)\n"; 47 } 48 if (!$end) { 49 print "* OPTIONAL: choose an end date -e <date> (default=today)\n"; 50 } 51 if (!$cumulative) { 52 print "* OPTIONAL: cumulative metrics for date range -c (default=off)\n"; 53 } 54 if (!$index) { 55 print "* OPTIONAL: create index file for all metrics -i (default=off)\n"; 44 56 } 45 57 … … 52 64 $czarDb->setDateFormat("%Y%m%d-%H%i%s"); 53 65 66 if ($index) { 67 68 my $metricsIndex = new czartool::MetricsIndex($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0); 69 $metricsIndex->writeHTML(); 70 exit; 71 } 54 72 55 73 if (!$day && !$begin && !$end) { … … 61 79 62 80 my $thisDay = $begin; 63 while (1) {64 81 65 my $dayMetrics = new czartool::DayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $thisDay); 66 $dayMetrics->writeHTML(); 82 if ($cumulative) { 67 83 68 $thisDay = $czarDb->addInterval($thisDay, "1 DAY");69 if ($czarDb->isBefore($end, $thisDay)) {last;}84 my $multiDayMetrics = new czartool::MultiDayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $begin, $end); 85 $multiDayMetrics->writeHTML(); 70 86 } 87 else { 88 89 while (1) { 90 91 my $dayMetrics = new czartool::DayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $thisDay); 92 $dayMetrics->writeHTML(); 93 94 $thisDay = $czarDb->addInterval($thisDay, "1 DAY"); 95 if ($czarDb->isBefore($end, $thisDay)) {last;} 96 } 97 } 98
Note:
See TracChangeset
for help on using the changeset viewer.
