Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-63151

Create ShardingDataTransformMetrics TimeObserver Stub Class

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.3.0
    • Sharding
    • Fully Compatible
    • Sharding 2022-02-07, Sharding 2022-02-21
    • 2

    Description

      Simple example of what it could look like

      ObservedClass {
       
          TimeObserver getTimeObserver() {
              return TimeObserver{[&] { return getTimeRunning(); }, [&] { return getTimeRemaining(); }};
          }
       
          Duration getTimeRunning();
          Duration getTimeRemaining();
      }
       
      TimeObserver {
      public:
          using DurationFunction = std::function<Duration()>;
       
          TimeObserver(DurationFunction timeRunning, DurationFunction timeRemaining);
       
          Duration getTimeRunning() {
              return _timeRunning();
          }
       
          Duration getTimeRemaining() {
              return _timeRemaining();
          }
       
      private:
          DurationFunction _timeRunning;
          DurationFunction _timeRemaining;
      }
      

      Attachments

        Activity

          People

            luis.osta@mongodb.com Luis Osta (Inactive)
            luis.osta@mongodb.com Luis Osta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: