[SERVER-63151] Create ShardingDataTransformMetrics TimeObserver Stub Class Created: 31/Jan/22  Updated: 29/Oct/23  Resolved: 14/Feb/22

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.3.0

Type: New Feature Priority: Major - P3
Reporter: Luis Osta (Inactive) Assignee: Luis Osta (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2022-02-07, Sharding 2022-02-21
Participants:
Story Points: 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;
}



 Comments   
Comment by Githook User [ 09/Feb/22 ]

Author:

{'name': 'Brett Nawrocki', 'email': 'brett.nawrocki@mongodb.com', 'username': 'brettnawrocki'}

Message: SERVER-63151 Create ShardingDataTransformMetrics Observer Stub Class
Branch: master
https://github.com/mongodb/mongo/commit/9b65815f7770953c6bf4cfd15c3751c19fa88d0a

Comment by Max Hirschhorn [ 05/Feb/22 ]

I'd rather see us using a pure virtual base class to define the interface rather than a series of input lambda functions.

Generated at Thu Feb 08 05:57:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.