Adds the mapping with the duration to the statistics.

@return this instance.
2844
public ResourceModelStatistics countMappingDuration(int durationInMs) {
        // The right-hand interval boundaries are pre-calculated. We start at the smallest (1) of the
        // interval [0, 1). Thus, when our value is less than the boundary, we know it is in the current interval (i),
        // as the right-hand boundary is exclusive.
        for (int i = 0; i < this.indexBoundaries.length; ++i) {
            if (durationInMs < this.indexBoundaries[i]) {
                ++this.mappingDurationFrequencies[i];
                return this;
            }
        }

        // The mapping duration time exceeds the frequency table boundaries.
        // Fallback: count it as the longest possible duration
        ++this.mappingDurationFrequencies[this.mappingDurationFrequencies.length - 1];
        return this;
    }
1296649
protected int[] addPeriodInto(int[] values, ReadablePeriod period) {
        for (int i = 0, isize = period.size(); i < isize; i++) {
            DurationFieldType type = period.getFieldType(i);
            int value = period.getValue(i);
            if (value != 0) {
                int index = indexOf(type);
                if (index == -1) {
                    throw new IllegalArgumentException(
                        "Period does not support field '" + type.getName() + "'");
                } else {
                    values[index] = FieldUtils.safeAdd(getValue(index), value);
                }
            }
        }
        return values;
    }
219130
public void add(ReadableDuration duration) {
        if (duration != null) {
            add(new Period(duration.getMillis(), getPeriodType()));
        }
    }
560889
public Map<String, Object> toMap() {
        Map<String, Object> ret = new HashMap<>();
        ret.put(MetricUploader.METRIC_TIME, timestamp);
        ret.put(MetricUploader.METRIC_TYPE, type);
        
        return ret;
    }
654096
public void set(long count, long startTime, long lastSampleTime) {
        this.count = count;
        this.startTime = startTime;
        this.lastSampleTime = lastSampleTime;
    }
1035956
public <T> void addMetric(String name, MetricTimeslice<T> timeslice)
    {
        metrics.put(name, timeslice);
    }
24461
public D plus(D duration) {

        if (duration.isEmpty()) {
            return this.self();
        }

        long value = this.amount;
        return this.with(MathUtils.safeCast(value + duration.getAmount()));

    }
677799
public static <T extends Number> ImmutableNumberStatistics<T> copyOf(NumberStatistics<? extends T> statistics){
		return new ImmutableNumberStatistics<T>(statistics);
	}
885731
public MachineTime<U> plus(MachineTime<U> duration) {

        if (duration.isEmpty()) {
            return this;
        } else if (this.isEmpty()) {
            return duration;
        }

        long s = Math.addExact(this.seconds, duration.seconds);
        int f = this.nanos + duration.nanos;
        return new MachineTime<>(s, f, this.scale);

    }
684752
@Override
  public DurationFormatterFactory setFallback(DateFormatter fallback) {
    boolean doReset = fallback == null
        ? this.fallback != null
        : !fallback.equals(this.fallback);
    if (doReset) {
      this.fallback = fallback;
      reset();
    }
    return this;
  }
205102
public ElementDefinitionDt addMapping(Mapping theValue) {
		if (theValue == null) {
			throw new NullPointerException("theValue must not be null");
		}
		getMapping().add(theValue);
		return this;
	}
834732
@SuppressWarnings("unused")
  public void addAll(ScalingStats stats)
  {
    synchronized (lock) {
      synchronized (stats.lock) {
        recentEvents.addAll(stats.recentEvents);
      }
    }
  }
1069397
public PublicEndpoint withMetrics(java.util.Map<String, Double> metrics) {
        setMetrics(metrics);
        return this;
    }
24279
@Override
    public V put(Long timestamp, V object) {
        return this.timeSeriesMap.put(buildKeyTimestamp(timestamp), object);
    }
1072126
public long maxTimestamp()
  {
    return ranges == null
            ? topLevel.markedForDeleteAt
            : Math.max(topLevel.markedForDeleteAt, ranges.maxMarkedAt());
  }
362140
public static PeriodDuration of(Duration duration) {
        Objects.requireNonNull(duration, "The duration must not be null");
        return new PeriodDuration(Period.ZERO, duration);
    }
529166
public java.util.Map<java.lang.String, alluxio.grpc.MetricValue> getMetricsMap() {
    return internalGetMetrics().getMap();
  }