add method

void add(
  1. int value
)

Adds a sample.

Implementation

void add(int value) {
  if (_sealed) {
    throw StateError('Cannot add value to sealed sampler.');
  }
  absMax = max(absMax, value);
  final delta = value - initialValue;
  deltaMax = max(deltaMax, delta);

  _deltaSum += delta;
  _absSum += value;

  samples++;
}