Returns the total number of processed events.
548050
public long processedCount() {
        long size = 0;
        for (Worker worker : workers) {
            size += worker.processed.inc();
        }
        return size;
    }
1280232
public int getTotalValidWaitingOperationCount() {
        int count = 0;
        for (WaitSet waitSet : waitSetMap.values()) {
            count += waitSet.totalValidWaitingOperationCount();
        }
        return count;
    }
1297378
def _getNextEventBatch(self):
        """"""
        self._eventPage += 1
        # if we have already obtained all pages, then exit
        if self._totalPages != None and self._eventPage > self._totalPages:
            return
        self.setRequestedResult(RequestEventsInfo(page=self._eventPage, count=self._eventBatchSize,
            sortBy= self._sortBy, sortByAsc=self._sortByAsc,
            returnInfo = self._returnInfo))
        # download articles and make sure that we set the same archive flag as it was returned when we were processing the uriList request
        if self._er._verboseOutput:
            print("Downloading event page %d..." % (self._eventPage))
        res = self._er.execQuery(self)
        if "error" in res:
            print("Error while obtaining a list of events: " + res["error"])
        else:
            self._totalPages = res.get("events", {}).get("pages", 0)
        results = res.get("events", {}).get("results", [])
        self._eventList.extend(results)
774643
@VisibleForTesting
	public int numProcessingTimeTimers() {
		int count = 0;
		for (InternalTimerServiceImpl<?, ?> timerService : timerServices.values()) {
			count += timerService.numProcessingTimeTimers();
		}
		return count;
	}
1267919
def get_events(self):
        '''
        
        '''
        ret = []
        while True:
            event = self.event.get_event(wait=1, full=True)
            if event is None:
                return ret
            ret.append(event)
349263
public function getEvents()
    {
        $inotifyEvents = $this->readEvents();

        $inotifyEvents = is_array($inotifyEvents) ? $inotifyEvents : array();

        $last = end($inotifyEvents);
        if (IN_Q_OVERFLOW === $last['mask']) {
            throw new RuntimeException('Event queue overflowed. Either read events more frequently or increase the limit for queues. The limit can be changed in /proc/sys/fs/inotify/max_queued_events');
        }

        foreach ($inotifyEvents as $event) {
            foreach ($this->bag->get($event['wd']) as $watched) {
                $watched->setEvent($event['mask'], $event['name']);
            }
        }

        $events = array();

        foreach ($this->checkers as $meta) {
            $tracked = $meta['tracked'];
            $watched = $meta['checker'];
            foreach ($watched->getChangeset() as $change) {
                $events[] = new FilesystemEvent($tracked, $change['resource'], $change['event']);
            }
        }

        return $events;
    }
963205
static function process()
    {
        $limit = 100;
        $offset = 0;
        $availableHandlers = eZNotificationEventFilter::availableHandlers();
        do
        {
            $eventList = eZNotificationEvent::fetchUnhandledList( array( 'offset' => $offset, 'length' => $limit ) );
            foreach( $eventList as $event )
            {
                $db = eZDB::instance();
                $db->begin();

                foreach( $availableHandlers as $handler )
                {
                    if ( $handler === false )
                    {
                        eZDebug::writeError( "Notification handler does not exist: $handlerKey", __METHOD__ );
                    }
                    else
                    {
                        $handler->handle( $event );
                    }
                }
                $itemCountLeft = eZNotificationCollectionItem::fetchCountForEvent( $event->attribute( 'id' ) );
                if ( $itemCountLeft == 0 )
                {
                    $event->remove();
                }
                else
                {
                    $event->setAttribute( 'status', eZNotificationEvent::STATUS_HANDLED );
                    $event->store();
                }

                $db->commit();
            }
            eZContentObject::clearCache();
        } while ( count( $eventList ) == $limit ); // If less than limit, we're on the last iteration

        eZNotificationCollection::removeEmpty();
    }
878280
def count_events():
    
    # wait loop
    while 1:
        # sleep and let the queue build up
        gevent.sleep(FLUSH_INTERVAL)

        # init the data points containers
        events = Counter()
        additional = {}

        # flush the queue
        while 1:
            try:
                site, content_id, event, path = EVENTS_QUEUE.get_nowait()
                events[(site, content_id)] += 1
                if event and path:
                    additional[(site, content_id)] = (event, path)
            except queue.Empty:
                break
            except Exception as e:
                LOGGER.exception(e)
                break

        # after tabulating, spawn a new thread to send the data to influxdb
        if len(events):
            gevent.spawn(send_point_data, events, additional)
            gevent.spawn(send_trending_data, events)
159298
public int getActiveCount() {
        final ReentrantLock mainLock = this.mainLock;
        mainLock.lock();
        try {
            int n = 0;
            for (Worker w : workers)
                if (w.isLocked())
                    ++n;
            return n;
        } finally {
            mainLock.unlock();
        }
    }
612726
private void listEvents(JobID jobId, int fromEventId, int numEvents)
    throws IOException {
    TaskCompletionEvent[] events =
      jobSubmitClient.getTaskCompletionEvents(jobId, fromEventId, numEvents);
    System.out.println("Task completion events for " + jobId);
    System.out.println("Number of events (from " + fromEventId +
                       ") are: " + events.length);
    for(TaskCompletionEvent event: events) {
      System.out.println(event.getTaskStatus() + " " + event.getTaskAttemptId() + " " +
                         getTaskLogURL(event.getTaskAttemptId(),
                                       event.getTaskTrackerHttp()));
    }
  }
1083785
private void getNextEventIndex() {
        for (int i = next + 1; i < events.size(); i++) {
            String evName = getValueOr(events.get(i), "event", "");
            if (evName.equals(eventType)) {
                next = i;
                return;
            }
        }
        next = events.size();
    }
46476
def count(self):
        
        return self.mapPartitions(lambda i: [sum(1 for _ in i)]).reduce(operator.add)
138287
@SuppressWarnings({"unused", "WeakerAccess"})
    public int getTotalVisits() {
        EventDetail ed = getLocalDataStore().getEventDetail(Constants.APP_LAUNCHED_EVENT);
        if (ed != null) return ed.getCount();

        return 0;
    }
699703
def GetEvents(self):
    
    for event in self._GetAttributeContainers('event'):
      if hasattr(event, 'event_data_row_identifier'):
        event_data_identifier = identifiers.SQLTableIdentifier(
            'event_data', event.event_data_row_identifier)
        event.SetEventDataIdentifier(event_data_identifier)

        del event.event_data_row_identifier

      yield event
1145912
function() {
    // Set `eventQueue` to null before processing it so that we can tell if more
    // events get enqueued while processing.
    var processingEventQueue = eventQueue;
    eventQueue = null;
    forEachAccumulated(processingEventQueue, executeDispatchesAndRelease);
    ("production" !== "development" ? invariant(
      !eventQueue,
      'processEventQueue(): Additional events were enqueued while processing ' +
      'an event queue. Support for this has not yet been implemented.'
    ) : invariant(!eventQueue));
  }
669126
function Counter() {
  this.total = 0;
  this.executed = 0;
  this.passed = 0;
  this.error = 0;
  this.failed = 0;
  this.timeout = 0;
  this.aborted = 0;
  this.inconclusive = 0;
  this.passedButRunAborted = 0;
  this.notRunnable = 0;
  this.notExecuted = 0;
  this.disconnected = 0;
  this.warning = 0;
  this.completed = 0;
  this.inProgress = 0;
  this.pending = 0;
}
1325510
def _resolve_process_count(self):
        
        length = len([d for d in self._dut_requirements if d.get("type") == "process"])
        self._process_count = length