Changeset 877
- Timestamp:
- 07/23/07 22:04:08 (6 years ago)
- Files:
-
- 2 modified
-
applications/shepherd (modified) (11 diffs)
-
status (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
applications/shepherd
r858 r877 2 2 3 3 my $progname = 'shepherd'; 4 my $version = '1.2. 0';4 my $version = '1.2.1'; 5 5 6 6 # tv_grab_au … … 227 227 if ($any_data) 228 228 { 229 &postprocess_data ;229 &postprocess_data unless ($opt->{skippost}); 230 230 &output_data; 231 231 &finalize_stats; … … 750 750 delete $pending_messages->{$progname}->{FAIL}; 751 751 &add_pending_message($progname, "SUCCESS", $sysid, $starttime, (time-$starttime), $region, $components_used); 752 $last_successful_run = time; 753 my $total_wanted = $plugin_data->{$progname}->{total_duration} + $plugin_data->{$progname}->{total_missing}; 754 $last_successful_run_data = ($total_wanted ? 100* $plugin_data->{$progname}->{total_duration} / $total_wanted : 0); 755 756 $last_successful_runs->{$last_successful_run} = $last_successful_run_data; 752 unless ($opt->{dontcallgrabbers}) 753 { 754 $last_successful_run = time; 755 my $total_wanted = $plugin_data->{$progname}->{total_duration} + $plugin_data->{$progname}->{total_missing}; 756 $last_successful_run_data = ($total_wanted ? 100* $plugin_data->{$progname}->{total_duration} / $total_wanted : 0); 757 758 $last_successful_runs->{$last_successful_run} = $last_successful_run_data; 759 } 757 760 } 758 761 … … 774 777 { 775 778 &log("Not posting usage statistics due to --" . ($opt->{nonotify} ? 'nonotify' : 'dontcallgrabbers' ) . " option.\n"); 779 &log("Would have posted: ".Dumper($pending_messages)) if ($debug); 776 780 } 777 781 else … … 1551 1555 noupdate 1552 1556 skipupdate 1557 skippost 1553 1558 disable=s 1554 1559 enable=s … … 2794 2799 my $msg; 2795 2800 my $component_start = time; 2796 if ( (defined $opt->{dontcallgrabbers}) && ($opt->{dontcallgrabbers})) {2801 if ($grabber eq 'yahoo7widget' or (defined $opt->{dontcallgrabbers}) && ($opt->{dontcallgrabbers})) { 2797 2802 &log("SHEPHERD: not calling grabber because of --dontcallgrabbers option, but will instead use existing $output\n"); 2798 2803 &log(1, "SHEPHERD: would have called: $comm\n"); … … 3646 3651 my $xmltv = $this_plugin->{xmltv}; 3647 3652 my ($encoding, $credits, $chan, $progs) = @$xmltv; 3648 $this_plugin->{total_duration} = 0; 3649 $this_plugin->{programmes} = 0; 3650 $this_plugin->{progs_with_invalid_date} = 0; # explicitly track unparsable dates 3651 $this_plugin->{progs_too_long} = 0; # explicitly track exxcessive programme durations 3652 $this_plugin->{progs_with_unknown_channel} = 0; # explicitly track unknown channels 3653 3654 # explicitly track unparsable dates, excessive durations, etc 3655 foreach ( qw( programmes total_duration progs_with_invalid_date progs_too_long progs_too_short progs_with_unknown channel progs_outside_window)) 3656 { 3657 $this_plugin->{$_} = 0; 3658 } 3653 3659 3654 3660 my $seen_channels_with_data = 0; … … 3706 3712 if ($this_duration < 1) { 3707 3713 &log(sprintf "- WARNING: plugin '%s' returned programme data with invalid duration (%s to %s): ignored.\n", $pluginname, $prog->{start}, $prog->{stop}); 3714 $this_plugin->{progs_too_short}++; 3708 3715 next; 3709 3716 } … … 3725 3732 3726 3733 # programme is outside the timeslots we are interested in. 3727 next if ($t1 > $policy{endtime}); 3728 next if ($t2 < $policy{starttime}); 3734 if ($t1 > $policy{endtime} or $t2 < $policy{starttime}) 3735 { 3736 $this_plugin->{progs_outside_window}++; 3737 next; 3738 } 3729 3739 3730 3740 # store timeslot info … … 3747 3757 $channel_data->{$ch}->{timeslots}[$slotnum]++; 3748 3758 $this_plugin->{timeslots}->{$ch}[$slotnum]++; 3759 $this_plugin->{slots_filled}++; 3749 3760 } 3750 3761 } … … 3769 3780 (defined $this_plugin->{earliest_data_seen} ? POSIX::strftime("%a%d%b", localtime($this_plugin->{earliest_data_seen})) : 'no'), 3770 3781 (defined $this_plugin->{latest_data_seen} ? POSIX::strftime("%a%d%b", localtime($this_plugin->{latest_data_seen})) : 'data'); 3782 3783 if (!$this_plugin->{slots_filled}) 3784 { 3785 # Call this a failure if there was some kind of weirdness. If 3786 # the grabber genuinely couldn't retrieve any shows for the 3787 # requested period, that's MISSING_DATA, but if it did and 3788 # we couldn't understand them, that's a FAIL. 3789 3790 if ($this_plugin->{progs_with_invalid_date} 3791 or 3792 $this_plugin->{progs_too_long} 3793 or 3794 $this_plugin->{progs_too_short} 3795 or 3796 $this_plugin->{progs_outside_window} 3797 or 3798 $this_plugin->{progs_with_unknown_channel}) 3799 { 3800 $this_plugin->{valid} = 0; 3801 $this_plugin->{failure_reason} = 3802 sprintf "Unparseable: %d ch, %d shows, %d dur, %d slots, %d invalid_date, %d too_long, %d too_short, %d outside_window, %d unknown_channel", 3803 $seen_channels_with_data, 3804 $this_plugin->{programmes}, 3805 $this_plugin->{total_duration}, 3806 $this_plugin->{slots_filled}, 3807 $this_plugin->{progs_with_invalid_date}, 3808 $this_plugin->{progs_too_long}, 3809 $this_plugin->{progs_too_short}, 3810 $this_plugin->{progs_outside_window}, 3811 $this_plugin->{progs_with_unknown_channel}; 3812 } 3813 } 3771 3814 3772 3815 $plugin_data->{$plugin} = $this_plugin; -
status
r876 r877 1 application shepherd 1.2. 01 application shepherd 1.2.1 2 2 reference channel_list 4 3 3 reference Shepherd/Common.pm 0.23
