*/
BucketedTimeSeries(size_t numBuckets, Duration duration);
+ /*
+ * Create a new BucketedTimeSeries.
+ *
+ * This constructor is used to reconstruct a timeseries using
+ * previously saved data
+ */
+ BucketedTimeSeries(
+ TimePoint theFirstTime,
+ TimePoint theLatestTime,
+ Duration maxDuration,
+ const std::vector<Bucket>& bucketsList);
+
/*
* Adds the value 'val' at time 'now'
*
return firstTime_ > latestTime_;
}
+ /*
+ * Returns time of first update() since clear()/constructor.
+ * Note that the returned value is only meaningful when empty() is false.
+ */
+ TimePoint firstTime() const {
+ return firstTime_;
+ }
+
+ /*
+ * Returns time of last update().
+ * Note that the returned value is only meaningful when empty() is false.
+ */
+ TimePoint latestTime() const {
+ return latestTime_;
+ }
+
+ /*
+ * Returns actual buckets of values
+ */
+ const std::vector<Bucket>& buckets() const {
+ return buckets_;
+ }
+
/*
* Get the amount of time tracked by this timeseries.
*