Exemplo n.º 1
0
  def send(self, metric, datapoint):
    increment(self.attemptedRelays)
    if len(self.queue) >= settings.MAX_QUEUE_SIZE:
      log.relay('relay queue full for %s, dropping data' % self.remoteAddr)
      increment(self.fullQueueDrops)

    elif self.connectedProtocol:
      self.connectedProtocol.send(metric, datapoint)

    else:
      self.queue.append( (metric, datapoint) )
      increment(self.queuedUntilConnected)
Exemplo n.º 2
0
    def send(self, metric, datapoint):
        increment(self.attemptedRelays)

        if len(self.queue) >= settings.MAX_QUEUE_SIZE:
            log.relay('relay queue full for %s:%d, dropping data' %
                      self.remoteAddr)
            increment(self.fullQueueDrops)

        elif self.connectedProtocol:
            self.connectedProtocol.send(metric, datapoint)

        else:
            self.queue.append((metric, datapoint))
            increment(self.queuedUntilConnected)
Exemplo n.º 3
0
 def buildProtocol(self, addr):
   log.relay('connection to %s established' % self.remoteAddr)
   self.connectedProtocol = MetricPickleSender()
   self.connectedProtocol.factory = self
   self.connectedProtocol.queue = self.queue
   return self.connectedProtocol
Exemplo n.º 4
0
 def startedConnecting(self, connector):
   log.relay('connecting to %s' % self.remoteAddr)
Exemplo n.º 5
0
 def clientConnectionFailed(self, connector, reason):
   ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
   log.relay("connection attempt to %s failed: %s" % (self.remoteAddr, reason.value))
Exemplo n.º 6
0
 def clientConnectionLost(self, connector, reason):
   ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
   self.connectedProtocol = None
   log.relay("connection to %s lost: %s" % (self.remoteAddr, reason.value))
Exemplo n.º 7
0
 def buildProtocol(self, addr):
     log.relay('connection to %s:%d established' % self.remoteAddr)
     self.connectedProtocol = MetricPickleSender()
     self.connectedProtocol.factory = self
     self.connectedProtocol.queue = self.queue
     return self.connectedProtocol
Exemplo n.º 8
0
 def startedConnecting(self, connector):
     log.relay('connecting to %s:%d' % self.remoteAddr)
Exemplo n.º 9
0
 def clientConnectionFailed(self, connector, reason):
     ReconnectingClientFactory.clientConnectionFailed(
         self, connector, reason)
     log.relay("connection attempt to %s failed: %s" %
               (self.remoteAddr, reason.value))
Exemplo n.º 10
0
 def clientConnectionLost(self, connector, reason):
     ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
     self.connectedProtocol = None
     log.relay("connection to %s lost: %s" %
               (self.remoteAddr, reason.value))