def process_response(self, data):
     HostState.set_ls()
     self.transport.write("%s\n" % HostState.get_whole_stat())
 def dataReceived(self, data):
     HostState.set_ls()
     d = Deferred()
     # d.addCallback(get_metrics)
     d.addCallback(self.process_response)
     d.callback(None)