X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fstat%2Fmsg.pl;h=6dd9760fd3cf3eb4102b9a4c4041e610408b5e93;hb=c3505bcfc922cd712bad2c20b3479cf8d1dc54fe;hp=57eccca4293aea042bb48039e27863bc5890f3ca;hpb=629ca1bff41ef8c74e61267b36f4028581789789;p=spider.git diff --git a/cmd/stat/msg.pl b/cmd/stat/msg.pl index 57eccca4..6dd9760f 100644 --- a/cmd/stat/msg.pl +++ b/cmd/stat/msg.pl @@ -1,7 +1,7 @@ # # show all the values on a message header # -# $Id$ +# # my ($self, $line) = @_; @@ -13,22 +13,26 @@ return (1, $self->msg('e5')) if $self->priv < 1; if (@list == 0) { my $ref; push @out, "Work Queue Keys"; - push @out, map { " $_" } sort DXMsg::get_all_fwq(); + push @out, map { " $_" } sort (DXMsg::get_all_fwq()); push @out, "Busy Queue Data"; - foreach $ref (sort {$a->to cmp $b->to} DXMsg::get_all_busy) { - my $msgno = $ref->msgno; - my $stream = $ref->stream; - my $lref = $ref->lines; - my $lines = 0; - $lines = @$lref if $lref; - my $count = $ref->count; - my $to = $ref->to; - my $from = $ref->from; - my $tonode = $ref->tonode; - my $lastt = $ref->lastt ? " Last Processed: " . cldatetime($ref->lastt) : ""; - my $waitt = $ref->waitt ? " Waiting since: " . cldatetime($ref->waitt) : ""; - - push @out, " $tonode: $from -> $to msg: $msgno stream: $stream Count: $count Lines: $lines$lastt$waitt"; + foreach my $key (sort (DXMsg::get_all_busy())) { + $ref = DXMsg::get_busy($key); + if ($ref) { + my $msgno = $ref->msgno; + my $stream = $ref->stream; + my $lref = $ref->lines; + my $lines = 0; + $lines = @$lref if $lref; + my $count = $ref->count; + my $to = $ref->to; + my $from = $ref->from; + my $tonode = $ref->tonode; + my $lastt = $ref->lastt ? " Last Processed: " . cldatetime($ref->lastt) : ""; + my $waitt = $ref->waitt ? " Waiting since: " . cldatetime($ref->waitt) : ""; + push @out, " $key/$tonode: $from -> $to msg: $msgno stream: $stream Count: $count Lines: $lines$lastt$waitt" + } else { + push @out, " dangling ref for $key"; + } } } else { foreach my $msgno (@list) {