--- trunk/lib/Sack/Client.pm 2010/04/28 08:08:47 273 +++ trunk/lib/Sack/Client.pm 2010/04/28 19:09:54 274 @@ -28,6 +28,12 @@ my $data = Storable::retrieve $data_path if -e $data_path; +sub proc { + local $/ = undef; + open(my $fh, '<', '/proc/' . shift); + <$fh>; +} + while (1) { for my $sock ($sel->can_read(1)) { my $request = eval { Storable::fd_retrieve($sock) }; @@ -39,6 +45,7 @@ my $response = { port => $port }; if ( $request->{ping} ) { $response->{ping} = 'pong'; + $response->{proc}->{$_} = proc $_ foreach ( 'loadavg', 'meminfo', "$$/status" ); } elsif ( $request->{load} ) { $response->{load} = 'shard'; } elsif ( $request->{bulk_load} ) {