Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. If the first flow-file is timestamped 12:12:00 21st March 2007 and one of the report types specified is hourly reports, then the first report will come out at 13:00:00. After that all reports will keep coming out at 14:00:00, 15:00:00 and so on for the regular clock hours.
  2. Similarly for the above example if 15 minute reports are also specified then the first report will come out at 12:15:00 i.e. after only two flow files. However after that reports will keep coming out after 15 minutes at 12:30:00 and 12:45:00 etc .
  3. Again taking the above example, if three-hourly reports are also specified then the first report will come out at 15:00:00 and then at 18:00:00
  4. Similarly if daily reports are specified then the first report will come out for as soon as the final flow-file for 21st March 2007 has been processed. ( Note that if the earlier system were in place, then in this case the first daily report would have come out at 12:12:00 22nd March 2007)
Code Block

if ( $report->{count} * $samplerate < 60 ){ # i.e. if size of report interval is less than an hour (e.g. 15 minute reports)

                        my $aligned_timestamp = Time::Local::timelocal (0,0,$hour, $mday, $mon, $year,$wday, $yday, $isdst );
                        my $current_timestamp = $self->{filetime};
                        my $mod = ($current_timestamp - $aligned_timestamp) % ($report->{count} * $samplerate * 60);
                        $report->{aggdata}{startperiod} = $current_timestamp - $mod;
                }
                elsif( $report->{count} * $samplerate < 1440 ){ # i.e. if size of report interval is less than a day (e.g. six-hourly reports)

                        my $aligned_timestamp  = Time::Local::timelocal (0,0,0, $mday, $mon, $year,$wday, $yday, $isdst );
                        my $current_timestamp = $self->{filetime};
                        my $mod = ($current_timestamp - $aligned_timestamp) % ($report->{count} * $samplerate * 60) ;
                        $report->{aggdata}{startperiod} = $current_timestamp - $mod;
                }
                elsif( $report->{count} * $samplerate < 40320 ) { # i.e. if the size of the report interval is less than a month (e.g. 15 day report)

                        my $aligned_timestamp  = Time::Local::timelocal (0,0,0,1, $mon, $year,0, 0, $isdst );
                        my $current_timestamp = $self->{filetime};
                        my $mod = ($current_timestamp - $aligned_timestamp) % ($report->{count} * $samplerate * 60) ;
                        $report->{aggdata}{startperiod} = $current_timestamp - $mod;
                }