Changes counter by delta.

    Args:
      counter_name: the name of the counter to change. str.
      delta: int.
513805
def incr(self, counter_name, delta=1):
    
    self._state.counters_map.increment(counter_name, delta)
277634
public static void removeWeakCounter(Cache<WeakCounterKey, CounterValue> cache, CounterConfiguration configuration,
         String counterName) {
      ByteString counterNameByteString = ByteString.fromString(counterName);
      for (int i = 0; i < configuration.concurrencyLevel(); ++i) {
         cache.remove(new WeakCounterKey(counterNameByteString, i));
      }
   }
94323
def update_counts(self, current):
        
        for item in current:
            try:
                self.counts[item] += 1
            except KeyError:
                self.counts[item] = 1
849770
def counters!
      the_counters = { processing: 0 }

      names = @lifecycle.states.keys
      results = RedisRds::Object.connection.multi do
        self.class::STATES_TERMINAL.each { |name| get_list(name).size }
        names.each { |name| get_list(name).size }
        @processing.getall
      end

      (self.class::STATES_TERMINAL + names).each do |name|
        the_counters[name] = results.shift.to_i
      end

      the_counters[:processing] = results.shift.reduce(0) { |sum, pair| sum + pair.last.to_i }

      return the_counters
    end
870323
public void updateCounter(final String iStatName, final long iPlus) {
    if (iStatName == null)
      return;

    // CHECK IF STATISTICS ARE ACTIVED
    if (recording < 0)
      return;

    synchronized (counters) {
      Long stat = counters.get(iStatName);

      long oldValue = stat == null ? 0 : stat.longValue();

      stat = new Long(oldValue + iPlus);

      counters.put(iStatName, stat);
    }
  }
1196100
def counter2trend(counter)
      self.new({
        enterprise: counter.enterprise,
        score: score(counter.divergence),
        uid: counter.uid,
        ts: counter.ts
      })
    end
247934
private void updateTypeCounts(T type, int delta) {
        if (!typeCounts.containsKey(type)) {
            assert delta > 0 
                : "removing edge type that was not originally present";
            typeCounts.put(type, delta);
        }
        else {
            int curCount = typeCounts.get(type);
            int newCount = curCount + delta;
            assert newCount >= 0 
                : "removing edge type that was not originally present";
            if (newCount == 0)
                typeCounts.remove(type);
            else
                typeCounts.put(type, newCount);
        }
    }
152548
@VisibleForTesting
	protected void assertCounterAmountMutatable(final String counterName, final CounterStatus counterStatus)
	{
		if (counterStatus != CounterStatus.AVAILABLE)
		{
			final String msg = String.format(
				"Can't mutate the amount of counter '%s' because it's currently in the %s state but must be in in "
					+ "the %s state!",
				counterName, counterStatus.name(), CounterStatus.AVAILABLE);
			throw new CounterNotMutableException(counterName, msg);
		}
	}
837807
def counter(module, name, count=1):
    
    counter = get_metric('counters', module, name, Counter())
    counter.inc(count)
1082590
public static Counter newCounter(String name, TaggingContext context) {
    final MonitorConfig config = MonitorConfig.builder(name).build();
    return new ContextualCounter(config, context, COUNTER_FUNCTION);
  }
140363
def _initialize_counters(model_class, name, bases, attrs):
    """"""
    model_class._counters = []
    for k, v in attrs.iteritems():
        if isinstance(v, Counter):
            model_class._counters.append(k)
647786
public static void increment(String name, TagList list, long delta) {
    final MonitorConfig config = MonitorConfig.builder(name).withTags(list).build();
    increment(config, delta);
  }
959656
def get_counter(self, name=None):
        '''
        '''
        return self.get_client(name=name, class_=statsd.Counter)
1291279
def do_counter_conversion(self):
        """"""
        if self.is_counter:
            if self._previous_counter_value is None:
                prev_value = self.latest_value
            else:
                prev_value = self._previous_counter_value
            self._previous_counter_value = self.latest_value
            self.latest_value = self.latest_value - prev_value
955168
public function incrementCounter($name, $value = 1) {
        if (!isset($this->counters[$name])) {
            $this->counters[$name] = 0;
        }
        $this->counters[$name] += $value;
    }
493125
public static void safeIncr(String counterName) {
    org.apache.heron.api.metric.GlobalMetrics.safeIncr(counterName);
  }
58391
def increase_and_check_counter(self):
        '''  '''
        self.counter += 1
        self.counter %= self.period
        if not self.counter:
            return True
        else:
            return False