summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog
diff options
context:
space:
mode:
authorWilliam Schultz <william.schultz@mongodb.com>2018-10-02 21:54:58 -0400
committerWilliam Schultz <william.schultz@mongodb.com>2018-10-02 21:57:52 -0400
commit982ba21e0ffbdaaf766dc8fa060728ba9b5f4914 (patch)
treeefc760c482e30bd70bfbaf5854779a89acf00ef3 /src/mongo/s/catalog
parent23d7c89e501d221a41f350b0b10a52a4f05bb2e2 (diff)
downloadmongo-982ba21e0ffbdaaf766dc8fa060728ba9b5f4914.tar.gz
SERVER-36697 Utilize TickSource for transactions timing metrics
This patch converts the existing transactions diagnostics timing related metrics to use a TickSource to record transaction durations. The TickSource is a high precision, mock-able time source for measuring the passage of time. This patch also converts the existing unit tests to use a mock TickSource, which allows the tests to fully virtualize time, making them much faster and less flaky.
Diffstat (limited to 'src/mongo/s/catalog')
-rw-r--r--src/mongo/s/catalog/replset_dist_lock_manager_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/s/catalog/replset_dist_lock_manager_test.cpp b/src/mongo/s/catalog/replset_dist_lock_manager_test.cpp
index e6527b548c3..231a3d62b2c 100644
--- a/src/mongo/s/catalog/replset_dist_lock_manager_test.cpp
+++ b/src/mongo/s/catalog/replset_dist_lock_manager_test.cpp
@@ -118,14 +118,14 @@ private:
class RSDistLockMgrWithMockTickSource : public ReplSetDistLockManagerFixture {
protected:
RSDistLockMgrWithMockTickSource() {
- getServiceContext()->setTickSource(stdx::make_unique<TickSourceMock>());
+ getServiceContext()->setTickSource(stdx::make_unique<TickSourceMock<>>());
}
/**
* Returns the mock tick source.
*/
- TickSourceMock* getMockTickSource() {
- return dynamic_cast<TickSourceMock*>(getServiceContext()->getTickSource());
+ TickSourceMock<>* getMockTickSource() {
+ return dynamic_cast<TickSourceMock<>*>(getServiceContext()->getTickSource());
}
};