IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29805


Ignore:
Timestamp:
Nov 22, 2010, 4:13:58 PM (15 years ago)
Author:
rhenders
Message:

now creating metrics from [revious day at 6:35am

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czarpoll.pl

    r29762 r29805  
    1313use czartool::Plotter;
    1414use czartool::Burntool;
     15use czartool::DayMetrics;
     16
    1517
    1618my $period = 60;
     
    2931my $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
    3032my $burntool = new czartool::Burntool();
     33
    3134
    3235$czarDb->setDateFormat("%Y%m%d-%H%i%s");
     
    107110    my $lastDay = strftime('%Y-%m-%d', localtime);
    108111    my $today = undef;
     112    my $doneMetricsToday = 1;
    109113
    110114    while (1) {
     
    118122                $czarDb->optimize();
    119123                $lastDay = $today;
     124                $doneMetricsToday = 0;
    120125        }
    121126
     
    124129        $end = $czarDb->getNowTimestamp();
    125130
     131        # if time now is after 06:35am, then create metrics for past 24 hours
     132        if (!$doneMetricsToday && $czarDb->isBefore($begin, $end)) {
     133       
     134                print "* Creating metrics for last 24 hours\n";
     135                # TODO hardcopded path needs to be in config
     136                my $dayMetrics = new czartool::DayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $today);
     137                $dayMetrics->writeHTML();
     138
     139                $doneMetricsToday = 1;
     140        }
     141
     142        # if time now is before 06:35am, include data from previous day
    126143        if ($czarDb->isBefore($end, $begin)) {
    127144
Note: See TracChangeset for help on using the changeset viewer.