private int m_counter;
543495
private void verifyDataCapacity(int size) {
        if (size+4 > m_dataNetwork.capacity()) {
            m_dataNetworkOrigin.discard();
            m_dataNetworkOrigin = org.voltcore.utils.DBBPool.allocateDirect(size+4);
            m_dataNetwork = m_dataNetworkOrigin.b();
            m_dataNetwork.position(4);
            m_data = m_dataNetwork.slice();
        }
    }
521361
private static int count(final String needle, final String haystack) {
        int count = 0;
        int pos = -1;
        while ((pos = haystack.indexOf(needle, pos + 1)) >= 0) {
            count++;
        }
        return count;
    }
615584
function incrementCounter() {
            for (var i = innerLen-1; i >= innerLen-4; i--) {
                inner[i]++;
                if (inner[i] <= 0xff) return;
                inner[i] = 0;
            }
        }
1295411
def GetMemSwappedMB(self):
        ''''''
        counter = c_uint()
        ret = vmGuestLib.VMGuestLib_GetMemSwappedMB(self.handle.value, byref(counter))
        if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
        return counter.value
110218
def GetMemBalloonedMB(self):
        ''''''
        counter = c_uint()
        ret = vmGuestLib.VMGuestLib_GetMemBalloonedMB(self.handle.value, byref(counter))
        if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
        return counter.value
1170093
int traverseAndCountElements() {
		int num = 0;

		for (Entry<?, ?> entry : table) {
			while (entry != null) {
				num++;
				entry = entry.next;
			}
		}

		return num;
	}
842530
private Counter initAndRegisterCounter(String name) {
        BasicCounter counter = new BasicCounter(MonitorConfig.builder(name).build());
        DefaultMonitorRegistry.getInstance().register(counter);
        return counter;
    }
71135
public int count()
    {
        int count = 0;
        for (int ii=bits-1;ii>=0;ii--)
        {
            if (isSet(ii))
            {
                count++;
            }
        }
        return count;
    }
398089
@Override
    public Counter counter(String name) {
        return this.counter(new Metadata(name, MetricType.COUNTER));
    }
474267
@VisibleForTesting
  String countersToString() {
    StringBuilder sb = new StringBuilder();
    sb.append("\n");
    double numNanoSecPerSec = TimeUnit.SECONDS.toNanos(1);
    String timeSuffix = "_TIME";
    for (Counter c : Counter.values()) {
      String name = c.toString();
      if (!name.endsWith(timeSuffix)) {
        // Log invocation counter.
        long count = counters.get(c).get();
        sb.append(String.format("%20s = %d calls\n", name, count));

        // Log duration counter.
        String timeCounterName = name + timeSuffix;
        double totalTime =
            counters.get(Enum.valueOf(Counter.class, timeCounterName)).get()
                / numNanoSecPerSec;
        sb.append(String.format("%20s = %.2f sec\n", timeCounterName, totalTime));

        // Compute and log average duration per call (== total duration / num invocations).
        String avgName = name + " avg.";
        double avg = totalTime / count;
        sb.append(String.format("%20s = %.2f sec / call\n\n", avgName, avg));
      }
    }
    return sb.toString();
  }
1272134
public int getCount(Object o) {
    int[] nums = (int[]) cset.get(o);   
    if (nums == null ) {
      return(0);
    }
    else {
      return(nums[0]);
    }
  }
769748
@Override
    protected void updateCount() {
        // set counter to the actual value, rather than to try and
        // keep track with a seperate variable.
        // This counter must only be updated by the selector thread,
        // which allows us to omit synchronized logic.
        // there can be timing windows where before we signal a deletion,
        // another request comes in, but the timeout logic will insure
        // that we don't delete an active selector.
        final int selectorCount = selector.keys().size();
        if (selectorCount > 0) {
            // if any keys, don't let selector die
            waitingToQuit = false;
        }
        wqm.updateCount(countIndex, selectorCount, channelType);
    }
846310
def _counter(self):
        """"""
        count = int(self._client.kv[self._counter_path])
        count += 1
        count_str = str(count).zfill(self._COUNTER_FILL)
        self._client.kv[self._counter_path] = count_str
        return count_str
387297
public synchronized int getCount(T actual, T predicted) {
        if (!matrix.containsKey(actual)) {
            return 0;
        } else {
            return matrix.get(actual).count(predicted);
        }
    }
1261269
Counter counter(Meter.Id id) {
        return registerMeterIfNecessary(Counter.class, id, this::newCounter, NoopCounter::new);
    }
1334485
def GetMemLimitMB(self):
        ''''''
        counter = c_uint()
        ret = vmGuestLib.VMGuestLib_GetMemLimitMB(self.handle.value, byref(counter))
        if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
        return counter.value
154165
def GetMemUsedMB(self):
        ''''''
        counter = c_uint()
        ret = vmGuestLib.VMGuestLib_GetMemUsedMB(self.handle.value, byref(counter))
        if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
        return counter.value