Ejemplo n.º 1
0
 def stringReceived(self, rawRequest):
     request = pickle.loads(rawRequest)
     log.query("%s" % request)
     datapoints = MetricCache.get(request['metric'])
     rs = dict(datapoints=datapoints)
     response = pickle.dumps(rs, protocol=-1)
     self.sendString(response)
Ejemplo n.º 2
0
 def connectionLost(self, reason):
     if reason.check(ConnectionDone):
         log.query("%s disconnected" % self.peerAddr)
     else:
         log.query("%s connection lost: %s" % (self.peerAddr, reason.value))
Ejemplo n.º 3
0
 def connectionLost(self, reason):
     if reason.check(ConnectionDone):
         log.query("%s disconnected" % self.peerAddr)
     else:
         log.query("%s connection lost: %s" % (self.peerAddr, reason.value))
Ejemplo n.º 4
0
 def connectionMade(self):
     peer = self.transport.getPeer()
     self.peerAddr = "%s:%s" % (peer.host, peer.port)
     log.query("%s connected" % self.peerAddr)
Ejemplo n.º 5
0
 def connectionMade(self):
     peer = self.transport.getPeer()
     self.peerAddr = "%s:%s" % (peer.host, peer.port)
     log.query("%s connected" % self.peerAddr)