void Counter::record()

in util/Stats.cpp [50:75]


void Counter::record(int64_t v) {
  int64_t newCount = ++count_;
  sum_ += v;
  if (newCount == 1) {
    realMin_ = min_ = max_ = v;
  }
  // don't count 0s in the min - makes for a slightly more interesting min
  // in most cases
  if (v && ((min_ == 0) || (v < min_))) {
    min_ = v;
  }
  // real min (can be 0):
  if (v < realMin_ ) {
    realMin_ = v;
  }
  if (v > max_) {
    max_ = v;
  }
  int64_t v2 = 0;
  if (v > INT32_MAX || v < INT32_MIN) {
    LOG(WARNING) << "v too big for stddev " << v;
  } else {
    v2 = v * v;
  }
  sumOfSquares_ += v2;  // atomic_add(sumOfSquares_, v2);
}