X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fdata_stats.pl;fp=cmd%2Fshow%2Fdata_stats.pl;h=7b37da06cf2679af6efec02f0cbefafd47c064a8;hb=cbb522ef802d48991734a4ce803fa6ffa9774588;hp=0000000000000000000000000000000000000000;hpb=e49e641d1a518e4f3b4308e078e06653e0b91a38;p=spider.git diff --git a/cmd/show/data_stats.pl b/cmd/show/data_stats.pl new file mode 100644 index 00000000..7b37da06 --- /dev/null +++ b/cmd/show/data_stats.pl @@ -0,0 +1,43 @@ +# +# show the users on this cluster from the routing tables +# +# Copyright (c) 1998 Dirk Koopman G1TLH +# +# +# + +sub handle +{ + my ($self, $line) = @_; + my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes + my @out; + if ($list[0] eq 'ALL') { + shift @list; + @list = keys %DXChannel::channels; + } + push @out, "Data Statitics IN OUT"; + push @out, "Callsign Lines Data Lines Data"; + push @out, "-----------------------------------------------------------------------------"; + if (@list) { + foreach my $call (sort @list) { + next if $call eq $main::mycall; + my $dxchan = DXChannel::get($call); + if ($dxchan) { + my $conn = $dxchan->conn; + push @out, sprintf("%-9.9s %16s %16s %16s %16s", $call, comma($conn->{linesin}), comma($conn->{datain}), comma($conn->{linesout}), comma($conn->{dataout})); + } + } + } + + push @out, "-----------------------------------------------------------------------------" if @out > 3; + push @out, sprintf("%-9.9s %16s %16s %16s %16s", "TOTALS", comma($Msg::total_lines_in), comma($Msg::total_in), comma($Msg::total_lines_out), comma($Msg::total_out)); + + return (1, @out); +} + +sub comma +{ + my $num = shift; + return scalar reverse(join(",",unpack("(A3)*", reverse int($num)))); +} +