6 use Data::Dump qw(dump);
8 my $sock = IO::Socket::INET->new(
9 PeerAddr => '127.0.0.1',
14 print "
\e[2J"; # Erase Screen
17 print "
\e[0;0H"; # Cursor Home
18 print "Gearman " . localtime(time()) . "\n";
19 printf " q r w function\n";
21 print $sock "STATUS\n";
23 while ( my $line = <$sock> ) {
27 next if $line =~ m/\t0$/; # ignore functions which don't have active workers
28 my ( $name, $queued, $running, $workers ) = split(/\t/,$line,4);
29 printf "%4d%4d%4d %s\n", $queued, $running, $workers, $name;
33 print $sock "WORKERS\n";
35 while ( my $line = <$sock> ) {