Exemple #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)
Exemple #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))
Exemple #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))
Exemple #4
0
 def connectionMade(self):
     peer = self.transport.getPeer()
     self.peerAddr = "%s:%s" % (peer.host, peer.port)
     log.query("%s connected" % self.peerAddr)
Exemple #5
0
 def connectionMade(self):
     peer = self.transport.getPeer()
     self.peerAddr = "%s:%s" % (peer.host, peer.port)
     log.query("%s connected" % self.peerAddr)