"stats" with Cache::Memcached Perl module

Stephane Legrand stephane@freebsd-fr.org
Thu, 8 Apr 2004 18:42:06 +0200


Hello,

Sorry to come back so quickly but i now have a problem with the
stats() method in the Perl module.

The following script : 

  use Cache::Memcached;
  my $client = new Cache::Memcached {
    'servers' => [ '127.0.0.1:50000' ]
  };
  $client->add('X', 10);
  $client->add('Y', 20);
  my $stats = $client->stats([qw(misc)]);
  use Data::Dumper;
  print Dumper($stats);
  
displays on the client side : 

  $VAR1 = {
          'hosts' => {
              '127.0.0.1:50000' => {
                  'misc' => {}
              }
          },
          'total' => {
              'cmd_get' => '0',
              'bytes' => '0',
              'get_hits' => '0',
              'connection_structures' => '0',
              'total_items' => '0',
              'bytes_read' => '0',
              'total_connections' => '0',
              'cmd_set' => '0',
              'bytes_written' => '0',
              'curr_items' => '0',
              'get_misses' => '0'
          }
  };
  
and on the server side : 

  bash$ memcached -p 50000 -m 16 -vv 
  <3 server listening
  <5 new client connection
  <5 add X 0 0 2
  >5 STORED
  <5 add Y 0 0 2
  >5 STORED
  <5 connection closed.


As you can see, all the stats are set to zero and the server doesn't
seem to receive a "stats" request.

I tried to narrow the problem in the Perl module. It seems that the
send() call (line 667) fails. $sock has the value "Sock_127.0.0.1:50000"
and $type is empty.

So, do i make something wrong in this script ? If yes, what is the
right way to use the stats() method ?


Regards,
Stephane.

-- 
Je recherche un emploi de développeur/admin. sys.
 (FreeBSD,Linux,PHP,Perl,MySQL,OCaml,Tcl/Tk...)
  ==> www.freebsd-fr.org/~stephane/cv.pdf <==