31 template <
typename TT = std::chrono::seconds>
35 using time_point = std::chrono::time_point<LegacyStatsClock, TT>;
63 template <
typename VT,
typename CT = LegacyStatsClock<std::chrono::seconds>>
94 const std::vector<Bucket>& bucketsList);
175 return buckets_.size();
204 return firstTime_ > latestTime_;
296 template <
typename ReturnType =
double>
298 return total_.template avg<ReturnType>();
307 template <
typename ReturnType =
double,
typename Interval = Duration>
309 return rateHelper<ReturnType, Interval>(ReturnType(total_.sum), elapsed());
324 template <
typename ReturnType =
double,
typename Interval = Duration>
326 return rateHelper<ReturnType, Interval>(
327 ReturnType(total_.count), elapsed());
361 template <
typename ReturnType =
double>
370 template <
typename ReturnType =
double,
typename Interval = Duration>
373 Duration interval = elapsed(start, end);
374 return rateHelper<ReturnType, Interval>(intervalSum, interval);
384 template <
typename ReturnType =
double,
typename Interval = Duration>
387 Duration interval = elapsed(start, end);
388 return rateHelper<ReturnType, Interval>(
389 ReturnType(intervalCount), interval);
405 template <
typename Function>
406 void forEachBucket(
Function fn)
const;
426 return buckets_[idx];
449 return addValueAggregated(
TimePoint(now), val, 1);
456 return addValueAggregated(
TimePoint(now), total, nsamples);
463 template <
typename ReturnType =
double,
typename Interval = Duration>
465 return detail::rateHelper<ReturnType, Duration, Interval>(
466 numerator, elapsedTime);
469 TimePoint getEarliestTimeNonEmpty()
const;
479 template <
typename Function>
bool addValueAggregated(Duration now, const ValueType &total, uint64_t nsamples)
std::atomic< int64_t > sum(0)
std::chrono::steady_clock::time_point now()
Duration duration() const
const Bucket & getBucketByIndex(size_t idx) const
ReturnType countRate() const
TimePoint getLatestTime() const
—— Concurrent Priority Queue Implementation ——
std::chrono::milliseconds Duration
std::vector< Bucket > buckets_
TimePoint latestTime() const
auto end(TestAdlIterable &instance)
bool addValue(Duration now, const ValueType &val, uint64_t times)
const ValueType & sum() const
size_t update(Duration now)
ReturnType rate(TimePoint start, TimePoint end) const
ReturnType rateHelper(ReturnType numerator, Duration elapsedTime) const
size_t numBuckets() const
bool addValue(Duration now, const ValueType &val)
TimePoint firstTime() const
void addValue(unsigned int iters, seconds duration, size_t numBuckets, size_t callsPerSecond)
const std::vector< Bucket > & buckets() const
Future< Unit > times(const int n, F &&thunk)
typename Clock::time_point TimePoint
StatsClock::time_point TimePoint
ReturnType countRate(TimePoint start, TimePoint end) const
std::chrono::nanoseconds time()
typename Clock::duration Duration
std::chrono::time_point< LegacyStatsClock, TT > time_point