Gets the total count for the last N window slots.

@param slots number of slots to include in the count
@return total count for last N slots
766238
public long get(int slots) {
    checkArgument(slots <= windowSlots,
        "Requested window must be less than the total window slots");

    long sum = 0;

    for (int i = 0; i < slots; i++) {
      int currentIndex = headSlot - i;
      if (currentIndex < 0) {
        currentIndex = counters.size() + currentIndex;
      }
      sum += counters.get(currentIndex).get();
    }

    return sum;
  }
406382
int removeDisposedChildSlot(Slot slot) {
		if (!slot.isReleased() || !subSlots.remove(slot)) {
			throw new IllegalArgumentException();
		}
		return subSlots.size();
	}
1177250
public synchronized int getPartitionStoreCount() {
        int count = 0;
        for (String store : storeToPartitionIds.keySet()) {
            count += storeToPartitionIds.get(store).size();
        }
        return count;
    }
1255797
protected function slot_state($tablerow, $slot) {
        $qa = $this->get_question_attempt($tablerow->usageid, $slot);
        $submissionsteps = $qa->get_steps_with_submitted_response_iterator();
        $step = $submissionsteps[$tablerow->try];
        if ($step === null) {
            return null;
        }
        if ($this->is_last_try($tablerow, $slot, $tablerow->try)) {
            // If this is the last try then the step with the try data does not contain the correct state. We need to
            // use the last step's state, after the attempt has been finished.
            return $qa->get_state();
        }
        return $step->get_state();
    }
1124134
protected int count(UserCustomResultSet resultSet) {
		int count = 0;
		try {
			count = resultSet.getCount();
		} finally {
			resultSet.close();
		}
		return count;
	}
760106
public final double sampleTotalCount()
  {
    long count = _totalCount.get();
    long lastCount = _lastTotalCount;
    _lastTotalCount = count;

    return count - lastCount;
  }
1249162
public int getTotalCreatedConnections(){
		int total=0;
		for (int i=0; i < this.partitionCount && this.partitions[i] != null; i++){
			total+=this.partitions[i].getCreatedConnections();
		}
		return total;
	}
197917
public static int count(final Iterable<Range<Long>> ranges) {
        int count = 0;
        for (Range<Long> range : ranges) {
            checkClosedOpen(range);
            count++;
        }
        return count;
    }
663713
@Override
    public int getPendingCount() {
        if (log.isDebugEnabled()) log.debug("Pending Count = " + latch.getCount());
        return (int) latch.getCount();
    }
862088
@Override
  public int count() {

    int listSize = getList().size();
    int pageSize = getPageSize();
    int pageCount = listSize / pageSize;

    pageCount += listSize % pageSize > 0 ? 1 : 0;

    return pageCount;
  }
477551
@VisibleForTesting
	public int numKeyValueStateEntries(Object namespace) {
		int sum = 0;
		for (StateTable<?, ?, ?> state : registeredKVStates.values()) {
			sum += state.sizeOfNamespace(namespace);
		}
		return sum;
	}
1236634
public static int getNumPoints(Geometry geometry) {
		if (geometry == null) {
			throw new IllegalArgumentException("Cannot get total number of points for null geometry.");
		}
		int count = 0;
		if (geometry.getGeometries() != null) {
			for (Geometry child : geometry.getGeometries()) {
				count += getNumPoints(child);
			}
		}
		if (geometry.getCoordinates() != null) {
			count += geometry.getCoordinates().length;
		}
		return count;
	}
391481
def cluster_count_key_in_slots(self, slot):
        """"""
        if not isinstance(slot, int):
            raise TypeError("Expected slot to be of type int, got {}"
                            .format(type(slot)))
        return self.execute(b'CLUSTER', b'COUNTKEYSINSLOT', slot)
883470
public int numberOfInserts() {
        final Integer cachedValue = numberOfInsertsCache;

        if (cachedValue != null) {
            return cachedValue;
        }

        int numberOfInserts = 0;

        for (T object : results.keySet()) {
            if (results.get(object).wasInserted()) {
                numberOfInserts++;
            }
        }

        numberOfInsertsCache = numberOfInserts;

        return numberOfInserts;
    }
1027826
public int numberOfElements() {
        int n = 0;
        for (SortedSet<Integer> cell : cells) {
            n += cell.size();
        }
        return n;
    }
492699
public BigInteger getTotalCounts(){
		BigInteger result = BigInteger.ZERO;
		for (AtomicLong c: counters.getMap().values()){
			result = result.add(BigInteger.valueOf(c.get()));
		}
		return result;
	}
539771
public synchronized int getTotalSubscriptions()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "getTotalSubscriptions");

    int totalSubscriptions = durableSubscriptions + nonDurableSubscriptions;

    if (tc.isEntryEnabled())
      SibTr.exit(
        tc,
        "getTotalSubscriptions",
        new Integer(totalSubscriptions));

    return totalSubscriptions;
  }