tensor/outputs/riemann.py
def emptyQueue(self):
        """Remove all or self.queueDepth events from the queue
        """
        if self.events:
            if self.queueDepth and (len(self.events) > self.queueDepth):
                # Remove maximum of self.queueDepth items from queue
                events = self.events[:self.queueDepth]
                self.events = self.events[self.queueDepth:]
            else:
                events = self.events
                self.events = []

            if self.allow_nan:
                self.factory.proto.sendEvents(events)
            else:
                self.factory.proto.sendEvents([e for e in events if e.metric is not None])
def emptyQueue(self):
        if self.events:
            if self.queueDepth and (len(self.events) > self.queueDepth):
                # Remove maximum of self.queueDepth items from queue
                events = self.events[:self.queueDepth]
                self.events = self.events[self.queueDepth:]
            else:
                events = self.events
                self.events = []

            if self.allow_nan:
                self.factory.proto.sendEvents(events)
            else:
                self.factory.proto.sendEvents([e for e in events if e.metric is not None])
def emptyQueue ( self ) : if self . events : if self . queueDepth and ( len ( self . events ) > self . queueDepth ) : # Remove maximum of self.queueDepth items from queue events = self . events [ : self . queueDepth ] self . events = self . events [ self . queueDepth : ] else : events = self . events self . events = [ ] if self . allow_nan : self . factory . proto . sendEvents ( events ) else : self . factory . proto . sendEvents ( [ e for e in events if e . metric is not None ] )
Remove all or self.queueDepth events from the queue
Remove all or self . queueDepth events from the queue