(self)
Retrieve slab stats from memcached.
Retrieve slab stats from memcached.
Retrieve slab stats from memcached .
def get_slab_stats(self):
        """Retrieve slab stats from memcached."""
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((self.host, self.port))
        s.send("stats slabs\n")
        try:
            data = ""
            while True:
                data += s.recv(4096)
                if data.endswith('END\r\n'):
                    break
            return data
        finally:
            s.close()
def get_slab_stats ( self ) : s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) s . connect ( ( self . host , self . port ) ) s . send ( "stats slabs\n" ) try : data = "" while True : data += s . recv ( 4096 ) if data . endswith ( 'END\r\n' ) : break return data finally : s . close ( )