Index: /trunk/tools/czarpoll.pl
===================================================================
--- /trunk/tools/czarpoll.pl	(revision 29804)
+++ /trunk/tools/czarpoll.pl	(revision 29805)
@@ -13,4 +13,6 @@
 use czartool::Plotter;
 use czartool::Burntool;
+use czartool::DayMetrics;
+
 
 my $period = 60;
@@ -29,4 +31,5 @@
 my $plotter = new czartool::Plotter($gpc1Db, $czarDb, "%Y%m%d-%H%M%S", "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8", "/tmp", $save_temps); # TODO hardcoded font path
 my $burntool = new czartool::Burntool();
+
 
 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
@@ -107,4 +110,5 @@
     my $lastDay = strftime('%Y-%m-%d', localtime);
     my $today = undef;
+    my $doneMetricsToday = 1;
 
     while (1) {
@@ -118,4 +122,5 @@
                 $czarDb->optimize();
                 $lastDay = $today;
+                $doneMetricsToday = 0;
         }
 
@@ -124,4 +129,16 @@
         $end = $czarDb->getNowTimestamp();
 
+        # if time now is after 06:35am, then create metrics for past 24 hours
+        if (!$doneMetricsToday && $czarDb->isBefore($begin, $end)) {
+        
+                print "* Creating metrics for last 24 hours\n";
+                # TODO hardcopded path needs to be in config
+                my $dayMetrics = new czartool::DayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $today); 
+                $dayMetrics->writeHTML();
+
+                $doneMetricsToday = 1;
+        }
+
+        # if time now is before 06:35am, include data from previous day
         if ($czarDb->isBefore($end, $begin)) {
 
