tensor/outputs/elasticsearch.py
def tick(self):
        """Clock tick called every self.inter
        """
        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 = []

            try:
                result = yield self.sendEvents(events)
                if result.get('errors', False):
                    log.msg(repr(result))
                    self.events.extend(events)

            except Exception as e:
                log.msg('Could not connect to elasticsearch ' + str(e))
                self.events.extend(events)
def tick(self):
        """Clock tick called every self.inter
        """
        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 = []

            try:
                result = yield self.sendEvents(events)
                if result.get('errors', False):
                    log.msg(repr(result))
                    self.events.extend(events)

            except Exception as e:
                log.msg('Could not connect to elasticsearch ' + str(e))
                self.events.extend(events)
def tick ( 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 = [ ] try : result = yield self . sendEvents ( events ) if result . get ( 'errors' , False ) : log . msg ( repr ( result ) ) self . events . extend ( events ) except Exception as e : log . msg ( 'Could not connect to elasticsearch ' + str ( e ) ) self . events . extend ( events )
Clock tick called every self.inter
Clock tick called every self . inter