--- /dev/null
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+use IO::Socket::INET;
+use Data::Dump qw(dump);
+
+my $sock = IO::Socket::INET->new(
+ PeerAddr => '127.0.0.1',
+ PeerPort => 4730,
+ Proto => 'tcp'
+) || die $1;
+
+print "\e[2J"; # Erase Screen
+
+while(1) {
+ print "\e[0;0H"; # Cursor Home
+ print "Gearman " . localtime(time()) . "\n";
+ printf " q r w function\n";
+
+ print $sock "STATUS\n";
+
+ while ( my $line = <$sock> ) {
+ chomp $line;
+# warn "# [$line]\n";
+ last if $line eq '.';
+ next if $line =~ m/\t0$/; # ignore functions which don't have active workers
+ my ( $name, $queued, $running, $workers ) = split(/\t/,$line,4);
+ printf "%4d%4d%4d %s\n", $queued, $running, $workers, $name;
+ }
+
+=for workers
+ print $sock "WORKERS\n";
+
+ while ( my $line = <$sock> ) {
+ chomp $line;
+ warn "# [$line]\n";
+ last if $line eq '.';
+ }
+=cut
+
+ sleep 1;
+}