Count of entries in the server(s).

@returns {module:promise.Promise.<Number>}
A promise that will be completed with the number of entries stored.
@memberof Client#
@since 0.3
430242
function() {
        var ctx = u.context(TINY);
        logger.debugf('Invoke size(msgId=%d)', ctx.id);
        return futureDecodeOnly(ctx, 0x29, p.decodeVInt);
      }
228756
def count(self):
        
        if self._result_cache is not None and not self._iter:
            return len(self._result_cache)

        return self.query.get_count()
1234352
public int getCount() {
		if (metadata != null && metadata.get("count") != null) {
			return Integer.parseInt(metadata.get("count"));
		}
		
		if (entities == null && entity !=null) {
			return 1;
		}
		
		return 0;
	}
698454
public CountQueryResult executeCount() {
		CountQueryResult ret = new CountQueryResult(this);
		Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
		if (so != null) {
			synchronized (so) {
				this.queryExecutor.executeCount();
			}
		} else
			this.queryExecutor.executeCount();
		return ret;
	}
532658
function count()
    {
        $realm = $this->getRealm();


        try {
            $sql = "SELECT COUNT(*) as has_key FROM `KVStore` WHERE `realm` = '$realm';";
            $stm = $this->pdo->prepare($sql);
            $stm->execute();
            $stm->setFetchMode(\PDO::FETCH_ASSOC);

            $count = $stm->fetch();
            $count = (int) $count['has_key'];

        } catch (\Exception $e) {
            throw new exReadError($e->getMessage(), $e->getCode(), $e);
        }

        return $count;
    }
649990
public static int count(Iterable it) {
        int n = 0;

        for(Object v: it) {
            if(v != null) {
                ++n;
            }
        }

        return n;
    }
707758
function() {
      if (this.subscriptions.length) {
        return Promise.map(this.subscriptions, (op) => {
          return op();
        })
        .then(() => {
          log.info(`Restarted ${this.subscriptions.length} subscriptions`);
        });
      }
      return Promise.resolve();
    }
84871
@Override
    public int getDiscardedResultsCount() {
        if (queryResults instanceof DiscardingBlockingQueue) {
            DiscardingBlockingQueue discardingBlockingQueue = (DiscardingBlockingQueue) queryResults;
            return discardingBlockingQueue.getDiscardedElementCount();
        } else {
            return -1;
        }
    }
867196
public long getNumberOfQueuedMessages() {
		if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
			SibTr.entry(tc, "getNumberOfQueuedMessages");

		long depth = itemStream.getTotalMsgCount();

		if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
			SibTr.exit(tc, "getNumberOfQueuedMessages", Long.valueOf(depth));

		return depth;
	}
862733
def count(request_criteria)
      return if ::ServiceMock.disable_stubs
      yield self if block_given?
      JSON.parse(http.post('/__admin/requests/count', request_criteria).body)['count']
    end
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;
}
965821
function()
    {
        if (this._executePromise)
            return this._executePromise;

        var q = this.clone();

        var table  = q._T.__name__;
        var page   = q._page;
        var fields = q._fields;

        // Create the query from our stuff
        var query = {};
        _(q._where.concat(q._like)).each(function (q) {
            query[q.key] = q.value;
        });

        var doneLoading      = Q.defer();
        this._executePromise = doneLoading.promise;

        var left = q._take;

        // A single iteration of fetching via the API. Called repeatedly in
        // the case of large / unbounded TAKES
        var loop = function() {

            // always take 1000 unless we're almost done
            var take = left < 1000 ? left : 1000;

            // Hit the API and incremement the page
            q._fetch(table, take, page++, query, fields).then(function(res) {

                // publish progress
                doneLoading.notify(q._results.length);

                if (left !== undefined) left -= res.length;

                // Either resolve the the promise with the results if we're
                // done or call the loop again

                if (q._doneLoading || left <= 0)
                    doneLoading.resolve(q._getResults());
                else
                    process.nextTick(loop);

            }).catch(function(err) {
                doneLoading.reject(err);
            });
        };

        // do tha damn thing
        loop();
        return doneLoading.promise;
    }
367347
function () {
            var ret;
            if (this.count <= this.__maxObjects && this.freeCount > 0) {
                ret = this.__freeObjects.dequeue();
                this.__inUseObjects.push(ret);
            } else if (this.count < this.__maxObjects) {
                ret = this.createObject();
                this.__inUseObjects.push(ret);
            }
            return ret;
        }
242823
protected int getCount(int type, Collection<ConnectionListener> listeners)
   {
      int count = 0;

      for (ConnectionListener cl : listeners)
      {
         if (cl.getState() == type)
            count++;
      }

      return count;
   }
132683
function () {
                    count = 100;
                    this.updateCount(count);
                    var self = this;
                    $timeout(function () {
                        self.hide();
                        $timeout(function () {
                            count = 0;
                            self.updateCount(count);
                        }, 500);
                    }, 1000);
                    return count;
                }
1153721
public long getNumberOfQueuedMessages()
  {
    long count = 0;
    try
    {
      count = itemStream.getStatistics().getTotalItemCount();
    }
    catch (MessageStoreException e)
    {
      FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.runtime.LocalQueuePoint.getNumberOfQueuedMessages",
          "1:494:1.58", 
          this);
      SibTr.exception(tc, e);
    }    
    return count;
  }
564545
def count(self):
        
        if not self.query.store.autocommit:
            self.query.store.checkpoint()
        target = ', '.join([
            tableClass.storeID.getColumnName(self.query.store)
            for tableClass in self.query.tableClass ])
        sql, args = self.query._sqlAndArgs(
            'SELECT DISTINCT',
            target)
        sql = 'SELECT COUNT(*) FROM (' + sql + ')'
        result = self.query.store.querySQL(sql, args)
        assert len(result) == 1, 'more than one result: %r' % (result,)
        return result[0][0] or 0