Changeset 1085

Show
Ignore:
Timestamp:
07/05/08 18:00:18 (5 years ago)
Author:
max
Message:

shepherd: Discriminate based on time period (peak/nonpeak/other) when determining whether a gap is "critical," i.e. worth logging to stats for grabbers known to have noncritical gaps

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/applications/shepherd

    r1084 r1085  
    22 
    33our $progname = 'shepherd'; 
    4 my $version = '1.3.15'; 
     4my $version = '1.3.16'; 
    55 
    66# tv_grab_au 
     
    42264226} 
    42274227 
     4228# Don't bother reporting small gaps when we already know that this 
     4229# grabber tends to have them. 
     4230# 
    42284231# It's actually difficult to say exactly which gaps are critical 
    42294232# (or policy-violating), because our analysis operates on a  
     
    42314234# in prime time is a policy violation, even though each individual 
    42324235# gap isn't. So our solution is not perfect: we are simply  
    4233 # stripping SMALL gaps (less than 15 minutes), regardless of how 
    4234 # many there are. 
     4236# disregarding SMALL gaps, regardless of how many there are. 
     4237# 
     4238# A gap is considered non-critical if it's: 
     4239# (a) in peak time and less than 15 minutes long; or 
     4240# (b) in nonpeak time and less than 30 minutes long; or 
     4241# (c) in other time and less than 25 minutes long 
    42354242sub is_noncritical_gap 
    42364243{ 
    42374244    my $gap = shift; 
    42384245 
    4239     return 1 if ($gap =~ /(\d+)-(\d+)/ and $2 - $1 < $policy{peak_max_missing}); 
    4240     return 0; 
     4246    return 0 unless ($gap =~ /(\d+)-(\d+)/); 
     4247    my $zero_hr = $policy{starttime} - $policy{first_bucket_offset}; 
     4248 
     4249    my $gap_start = (($1 - $zero_hr) % 86400); 
     4250    my $gap_stop = (($2 - $zero_hr) % 86400); 
     4251    my $diff = $gap_stop - $gap_start; 
     4252 
     4253    if ($gap_start <= $policy{peak_stop} and $gap_stop >= $policy{peak_start}) 
     4254    { 
     4255        # PEAK 
     4256        return ($diff < 15*60); 
     4257    } 
     4258    elsif ($gap_start <= $policy{nonpeak_stop} and $gap_stop >= $policy{nonpeak_start}) 
     4259    { 
     4260        # NONPEAK 
     4261        return ($diff < 30*60); 
     4262    } 
     4263    else 
     4264    { 
     4265        # OTHER 
     4266        return ($diff < 25*60); 
     4267    } 
    42414268} 
    42424269 
  • trunk/status

    r1084 r1085  
    1 application     shepherd            1.3.15 
     1application     shepherd            1.3.16 
    22reference       channel_list        22 
    33reference       Shepherd/Common.pm  0.36