-sub per_minute
-{
- foreach my $dxchan (DXChannel::get_all()) {
- next unless $dxchan->is_rbn;
- dbg "RBN:STATS minute $dxchan->{call} raw: $dxchan->{noraw} sent: $dxchan->{norbn} delivered: $dxchan->{nospot} users: " . scalar keys %{$dxchan->{nousers}} if isdbg('rbnstats');
- if ($dxchan->{noraw} == 0 && $dxchan->{lasttime} > 60) {
- LogDbg('RBN', "RBN: no input from $dxchan->{call}, disconnecting");
- $dxchan->disconnect;
- }
- $dxchan->{noraw} = $dxchan->{norbn} = $dxchan->{nospot} = 0; $dxchan->{nousers} = {};
- $runtime{$dxchan->{call}} += 60;
- }
-
- # save the spot cache
- write_cache() unless $main::systime + $startup_delay < $main::systime;;
-}
-
-sub per_10_minute
-{
- my $count = 0;
- my $removed = 0;
- while (my ($k,$v) = each %{$spots}) {
- if ($main::systime - $v->[0] > $minspottime*2) {
- delete $spots->{$k};
- ++$removed;
- }
- else {
- ++$count;
- }
- }
- dbg "RBN:STATS spot cache remain: $count removed: $removed"; # if isdbg('rbn');
- foreach my $dxchan (DXChannel::get_all()) {
- next unless $dxchan->is_rbn;
- dbg "RBN:STATS 10-minute $dxchan->{call} raw: $dxchan->{noraw10} sent: $dxchan->{norbn10} delivered: $dxchan->{nospot10} users: " . scalar keys %{$dxchan->{nousers10}};
- $dxchan->{noraw10} = $dxchan->{norbn10} = $dxchan->{nospot10} = 0; $dxchan->{nousers10} = {};
- }
-}
-
-sub per_hour
-{
- foreach my $dxchan (DXChannel::get_all()) {
- next unless $dxchan->is_rbn;
- dbg "RBN:STATS hour $dxchan->{call} raw: $dxchan->{norawhour} sent: $dxchan->{norbnhour} delivered: $dxchan->{nospothour} users: " . scalar keys %{$dxchan->{nousershour}};
- $dxchan->{norawhour} = $dxchan->{norbnhour} = $dxchan->{nospothour} = 0; $dxchan->{nousershour} = {};
- }
-}
-