NetServer-Portal

 view release on metacpan or  search on metacpan

lib/NetServer/Portal/Top.pm  view on Meta::CPAN

    $s .= $ln->("$name PID=$$ \@ $Host");

    my ($sec,$min,$hr) = localtime(time);
    my $tm = sprintf("| %02d:%02d:%02d [%4ds]", $hr,$min,$sec,$o->{seconds});
    $s .= term->Tgoto('cm', $uconf->{cols} - (1+length $tm), 0, $c->{io}->fd);
    $s .= $tm."\n";

    my @load;
    my @events = all_watchers();
    for my $sec (15,60,60*15) {
	my $busy = 0;
	for (@events) { $busy += ($_->stats($sec))[2] }
	my $idle = (idle_time($sec))[2];
	my $tm = $idle + $busy;
	push @load, $tm? $busy / $tm : 0;
    }

    my @all = map {
	[{ obj  => $_,
	   id   => assign_id($_),
	   desc => $_->desc,
	   prio => $_->prio },
	 $_->stats($o->{seconds})] } @events;
    push @all, [{ id => 0, desc => 'idle', prio => QUEUES },
		idle_time($o->{seconds})];



( run in 0.328 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )