Increment the metrics for numOps operations
@param numOps - number of operations
@param time - time for numOps operations
555969
public void inc(final int numOps, final long time) {
    lock.lock();
    try {
      currentData.numOperations += numOps;
      currentData.time += time;
      long timePerOps = time/numOps;
      minMax.update(timePerOps);
    } finally {
      lock.unlock();
    }
  }
879127
@SuppressWarnings("unchecked")
  public static void registerTopologyTimerEvents(Map<String, Object> conf,
                                                 String name, Duration interval,
                                                 Runnable task) {
    if (interval.isZero() || interval.isNegative()) {
      throw new IllegalArgumentException("Timer duration needs to be positive");
    }
    if (!conf.containsKey(Config.TOPOLOGY_TIMER_EVENTS)) {
      conf.put(Config.TOPOLOGY_TIMER_EVENTS, new HashMap<String, Pair<Duration, Runnable>>());
    }

    Map<String, Pair<Duration, Runnable>> timers
        = (Map<String, Pair<Duration, Runnable>>) conf.get(Config.TOPOLOGY_TIMER_EVENTS);

    if (timers.containsKey(name)) {
      throw new IllegalArgumentException("Timer with name " + name + " already exists");
    }
    timers.put(name, Pair.of(interval, task));
  }
503754
def _set_pseudotime(self):
        
        self.pseudotime = self.distances_dpt[self.iroot].copy()
        self.pseudotime /= np.max(self.pseudotime[self.pseudotime < np.inf])
18748
public void addPutTimeNanos(long duration) {
        for (;;) {
            long nanos = putTimeTakenNanos;
            if (nanos <= Long.MAX_VALUE - duration) {
                if (PUT_TIME_TAKEN_NANOS.compareAndSet(this, nanos, nanos + duration)) {
                    return;
                }
            } else {
                //counter full. Just reset.
                if (PUT_TIME_TAKEN_NANOS.compareAndSet(this, nanos, duration)) {
                    clear();
                    return;
                }
            }
        }
    }
417865
public void addMultipleItems(int times, final Object... values) {
		for (int i = 0; i < times; i++) {
            addItemAsArray(values);
        }
	}
1333926
public void updateStreams (float time)
    {
        // iterate backwards through the list so that streams can dispose of themselves during
        // their update
        for (int ii = _streams.size() - 1; ii >= 0; ii--) {
            _streams.get(ii).update(time);
        }

        // delete any finalized objects
        deleteFinalizedObjects();
    }
1311502
public void incrementCount(F first, S second, double inc) {
        Counter<S> counter = maps.get(first);
        if (counter == null) {
            counter = new Counter<S>();
            maps.put(first, counter);
        }

        counter.incrementCount(second, inc);
    }
757416
public void addMeasurement(long durationInMillis) {
    count.addAndGet(1);
    timerSum.addAndGet(durationInMillis);
    timerSumOfSquares.addAndGet(durationInMillis * durationInMillis);
  }
397643
public void addNano(long nanos)
    {
        // convert to microseconds. 1 millionth
        latency.update(nanos, TimeUnit.NANOSECONDS);
        totalLatency.inc(nanos / 1000);
        totalLatencyHistogram.add(nanos / 1000);
        recentLatencyHistogram.add(nanos / 1000);
        for(LatencyMetrics parent : parents)
        {
            parent.addNano(nanos);
        }
    }
683035
public void stats(String name, float value) {
		for (ICounters counter : _counters)
			counter.stats(name, value);
	}

	/**
	 * Records the last calculated measurement value.
	 * 
	 * Usually this method is used by metrics calculated externally.
	 * 
	 * @param name  a counter name of Last type.
	 * @param value a last value to record.
	 */
	public void last(String name, float value) {
		for (ICounters counter : _counters)
			counter.last(name, value);
	}

	/**
	 * Records the current time as a timestamp.
	 * 
	 * @param name a counter name of Timestamp type.
	 */
	public void timestampNow(String name) {
		timestamp(name, ZonedDateTime.now());
	}

	/**
	 * Records the given timestamp.
	 * 
	 * @param name  a counter name of Timestamp type.
	 * @param value a timestamp to record.
	 */
	public void timestamp(String name, ZonedDateTime value) {
		for (ICounters counter : _counters)
			counter.timestamp(name, value);
	}

	/**
	 * Increments counter by 1.
	 * 
	 * @param name a counter name of Increment type.
	 */
	public void incrementOne(String name) {
		increment(name, 1);
	}

	/**
	 * Increments counter by given value.
	 * 
	 * @param name  a counter name of Increment type.
	 * @param value a value to add to the counter.
	 */
	public void increment(String name, int value) {
		for (ICounters counter : _counters)
			counter.increment(name, value);
	}

}
1358270
public void addGetTimeNanos(long duration) {
        for (;;) {
            long nanos = getCacheTimeTakenNanos;
            if (nanos <= Long.MAX_VALUE - duration) {
                if (GET_CACHE_TIME_TAKEN_NANOS.compareAndSet(this, nanos, nanos + duration)) {
                    return;
                }
            } else {
                //counter full. Just reset.
                if (GET_CACHE_TIME_TAKEN_NANOS.compareAndSet(this, nanos, duration)) {
                    clear();
                    return;
                }
            }
        }
    }
1268814
public void addTimeInterval(T interval){
		timeIntervals.add(interval);
		minBorders.setStart(Math.max(minBorders.getStart(), interval.getStart()));
		minBorders.setEnd(Math.min(minBorders.getEnd(), interval.getEnd()));
		if(maxBorders == null){
			maxBorders = interval.clone();
		} else {
			maxBorders.setStart(Math.min(maxBorders.getStart(), interval.getStart()));
			maxBorders.setEnd(Math.max(maxBorders.getEnd(), interval.getEnd()));
		}
	}
639577
def Increment(self, delta, fields=None):
    """"""
    if delta < 0:
      raise ValueError(
          "Counter increment should not be < 0 (received: %d)" % delta)

    self._metric_values[_FieldsToKey(fields)] = self.Get(fields=fields) + delta
1240149
def timeit(self, metric, func, *args, **kwargs):
        """"""
        return metrics.timeit(metric, func, *args, **kwargs)
1312827
def increment(self):
        
        if self._starttime is not None:
            self._delta = datetime.datetime.now() - self._starttime
        else:
            self._delta = datetime.timedelta()
        
        self.refresh()
        self.ticked.emit()
1245183
def num_time_steps(self):
    """"""

    num_time_steps = sum(t.num_time_steps for t in self.trajectories)
    return num_time_steps + self.num_completed_time_steps
97505
private double calculateRate(long cumulative, long currentTime) {
    long timeSinceMapStart = 0;
    assert getPhase() == Phase.MAP : "MapTaskStatus not in map phase!";

    long startTime = getStartTime();
    timeSinceMapStart = currentTime - startTime;
    if (timeSinceMapStart <= 0) {
      LOG.error("Current time is " + currentTime + 
          " but start time is " + startTime);
      return 0;
    }
    
    return cumulative/timeSinceMapStart; 
  }