Beekeeper

 view release on metacpan or  search on metacpan

bin/bkpr-top  view on Meta::CPAN

  -h, --help       display this help and exit

Filters --host, --pool and --class can be combined.

The metrics displayed are:

   nps:   number of received notifications per second
   cps:   number of processed calls per second
   err:   number of errors per second
   mem:   resident non shared memory size in KiB
   cpu:   percentage of CPU load
   load:  percentage of busy time

Change sorting pressing (N)otifications, (C)alls, (M)emory, cp(U) or (L)oad.

";

if ($opt_help) {
    print $Help;
    exit;
}

bin/bkpr-top  view on Meta::CPAN

    -h, --help       display this help and exit
  
  Filters --host, --pool and --class can be combined.
  
  The metrics displayed are:
  
     nps:   number of received notifications per second
     cps:   number of processed calls per second
     err:   number of errors per second
     mem:   resident memory size in KiB
     cpu:   percentage of CPU load
     load:  percentage of busy time
  
  Change sorting field pressing (N)otifications, (C)alls, (M)emory, cp(U) or (L)oad.

=head1 DESCRIPTION

Display real-time performance metrics of running workers in a C<top> fashion.

Sorting order can be changed pressing keys N, C, M, U and L.
Pressing Q quits the program.

lib/Beekeeper/Worker.pm  view on Meta::CPAN

    $worker->{call_count} = 0;

    # Average notifications per second
    my $nps = sprintf("%.2f", $worker->{notif_count} / $period);
    $worker->{notif_count} = 0;

    # Average errors per second
    my $err = sprintf("%.2f", $worker->{error_count} / $period);
    $worker->{error_count} = 0;

    # Average load as percentage of wall clock busy time (not cpu usage)
    my $load = sprintf("%.2f", ($BUSY_TIME - $worker->{busy_time}) / $period * 100);
    $worker->{busy_time} = $BUSY_TIME;

    # Queues
    my %queues;
    foreach my $queue (keys %{$worker->{callbacks}}) {
        next unless $queue =~ m/^req\.(?!_sync)(.*)\./;
        $queues{$1} = 1;
    }



( run in 0.414 second using v1.01-cache-2.11-cpan-709fd43a63f )