]> dxcluster.net Git - spider.git/blob - cmd/show/spotstats.pl
See Changes
[spider.git] / cmd / show / spotstats.pl
1 # show the current received spot stats including
2 #   pc11s
3 #   pc61s
4 #   percentage of pc11s in the total no of (unique) pc11+pc61 spots
5 #   no of pc11s promoted to pc61 by stored ip address
6 #   no of pc11s promoted to pc61 because a pc61 with the same data came in just after the pc11
7 #   no of pc11 promoted to pc61 by any means
8 #   percentage of pc11 promoted to pc61s
9
10 my $self = shift;
11 return (1, $self->msg('e5')) unless $self->priv >= 1;
12 my @out;
13
14 my $r = DXProt::get_pc11_61_stats();
15 #$DB::single = 1;
16 if ($r) {
17         my $spots = $r->{pc61_rx} + $r->{pc11_rx};
18         my $stats = sprintf "spots pc61: $r->{pc61_rx} pc11: $r->{pc11_rx}(%0.1f%%) total: $spots - promotions - by pc61: $r->{pc11_to_61} by route: $r->{rpc11_to_61} total: $r->{promotions}(%0.1f%%)", $r->{pc11_percent}, $r->{promotions_percent};
19         push @out, $stats;
20 } else {
21         push @out, qq{pc11 stats not available};
22 }
23 return (1, @out);