a simple first step towards using clocks properly in the stats code
[folly.git] / folly / stats / MultiLevelTimeSeries.h
index f5a9d5a64dee0d05e5c2867f5d52d0bbf1be1c62..7a43f175ad32099c40d81a72e1daf56761a71ec6 100644 (file)
@@ -49,12 +49,18 @@ namespace folly {
  *
  * The class is not thread-safe -- use your own synchronization!
  */
-template <typename VT, typename TT=std::chrono::seconds>
+template <typename VT, typename CT = LegacyStatsClock<std::chrono::seconds>>
 class MultiLevelTimeSeries {
  public:
-  typedef VT ValueType;
-  typedef TT TimeType;
-  typedef folly::BucketedTimeSeries<ValueType, TimeType> Level;
+  using ValueType = VT;
+  using Clock = CT;
+  using Duration = typename Clock::duration;
+  using TimePoint = typename Clock::time_point;
+  // The legacy TimeType.  The older code used this instead of Duration and
+  // TimePoint.  This will eventually be removed as the code is transitioned to
+  // Duration and TimePoint.
+  using TimeType = typename Clock::duration;
+  using Level = folly::BucketedTimeSeries<ValueType, Clock>;
 
   /*
    * Create a new MultiLevelTimeSeries.