diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/collection_index_usage_tracker_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/query/query_yield.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/range_deleter.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/repl/read_concern_response.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/repl/read_concern_response.h | 10 | ||||
-rw-r--r-- | src/mongo/db/repl/read_concern_response_test.cpp | 3 |
6 files changed, 15 insertions, 19 deletions
diff --git a/src/mongo/db/collection_index_usage_tracker_test.cpp b/src/mongo/db/collection_index_usage_tracker_test.cpp index 5ce0988452c..b82583d5daf 100644 --- a/src/mongo/db/collection_index_usage_tracker_test.cpp +++ b/src/mongo/db/collection_index_usage_tracker_test.cpp @@ -141,7 +141,7 @@ TEST_F(CollectionIndexUsageTrackerTest, DateTimeAfterDeregister) { ASSERT(statsMap.find("foo") == statsMap.end()); // Increment clock source so that a new index registration has different start time. - getClockSource()->advance(stdx::chrono::milliseconds(1)); + getClockSource()->advance(Milliseconds(1)); getTracker()->registerIndex("foo", BSON("foo" << 1)); statsMap = getTracker()->getUsageStats(); diff --git a/src/mongo/db/query/query_yield.cpp b/src/mongo/db/query/query_yield.cpp index a4fbd5cca12..893184fb14f 100644 --- a/src/mongo/db/query/query_yield.cpp +++ b/src/mongo/db/query/query_yield.cpp @@ -78,7 +78,7 @@ void QueryYield::yieldAllLocks(OperationContext* txn, const BSONObj& data = customWait.getData(); BSONElement customWaitNS = data["namespace"]; if (!customWaitNS || planExecNS == customWaitNS.str()) { - sleepFor(stdx::chrono::milliseconds(data["waitForMillis"].numberInt())); + sleepFor(Milliseconds(data["waitForMillis"].numberInt())); } } diff --git a/src/mongo/db/range_deleter.cpp b/src/mongo/db/range_deleter.cpp index 22172c0bf35..2d9e9c04bd5 100644 --- a/src/mongo/db/range_deleter.cpp +++ b/src/mongo/db/range_deleter.cpp @@ -83,8 +83,8 @@ static void logCursorsWaiting(RangeDeleteEntry* entry) { // We always log the first cursors waiting message (so we have cursor ids in the logs). // After 15 minutes (the cursor timeout period), we start logging additional messages at // a 1 minute interval. - static const auto kLogCursorsThreshold = stdx::chrono::minutes{15}; - static const auto kLogCursorsInterval = stdx::chrono::minutes{1}; + static const auto kLogCursorsThreshold = Minutes{15}; + static const auto kLogCursorsInterval = Minutes{1}; Date_t currentTime = jsTime(); Milliseconds elapsedMillisSinceQueued{0}; @@ -423,8 +423,7 @@ void RangeDeleter::doWork() { { stdx::unique_lock<stdx::mutex> sl(_queueMutex); while (_taskQueue.empty()) { - _taskQueueNotEmptyCV.wait_for(sl, - stdx::chrono::milliseconds(kNotEmptyTimeoutMillis)); + _taskQueueNotEmptyCV.wait_for(sl, Milliseconds(kNotEmptyTimeoutMillis)); if (stopRequested()) { log() << "stopping range deleter worker" << endl; diff --git a/src/mongo/db/repl/read_concern_response.cpp b/src/mongo/db/repl/read_concern_response.cpp index 0b4ffdac470..2bcf68653c0 100644 --- a/src/mongo/db/repl/read_concern_response.cpp +++ b/src/mongo/db/repl/read_concern_response.cpp @@ -42,16 +42,14 @@ namespace repl { const string ReadConcernResponse::kWaitedMSFieldName("waitedMS"); ReadConcernResponse::ReadConcernResponse(Status status) - : ReadConcernResponse(status, stdx::chrono::milliseconds(0), false) {} + : ReadConcernResponse(status, Milliseconds(0), false) {} ReadConcernResponse::ReadConcernResponse() : ReadConcernResponse(Status::OK()) {} -ReadConcernResponse::ReadConcernResponse(Status status, stdx::chrono::milliseconds duration) +ReadConcernResponse::ReadConcernResponse(Status status, Milliseconds duration) : ReadConcernResponse(status, duration, true) {} -ReadConcernResponse::ReadConcernResponse(Status status, - stdx::chrono::milliseconds duration, - bool waited) +ReadConcernResponse::ReadConcernResponse(Status status, Milliseconds duration, bool waited) : _waited(waited), _duration(duration), _status(status) {} void ReadConcernResponse::appendInfo(BSONObjBuilder* builder) { @@ -66,7 +64,7 @@ bool ReadConcernResponse::didWait() const { return _waited; } -stdx::chrono::milliseconds ReadConcernResponse::getDuration() const { +Milliseconds ReadConcernResponse::getDuration() const { return _duration; } diff --git a/src/mongo/db/repl/read_concern_response.h b/src/mongo/db/repl/read_concern_response.h index 38773b7e1ac..e16fd61bd56 100644 --- a/src/mongo/db/repl/read_concern_response.h +++ b/src/mongo/db/repl/read_concern_response.h @@ -31,7 +31,7 @@ #include <string> #include "mongo/base/status.h" -#include "mongo/stdx/chrono.h" +#include "mongo/util/time_support.h" namespace mongo { @@ -56,7 +56,7 @@ public: /** * Constructs a response with wait set to true along with the given parameters. */ - ReadConcernResponse(Status status, stdx::chrono::milliseconds duration); + ReadConcernResponse(Status status, Milliseconds duration); /** * Appends to the builder the timeout and duration info if didWait() is true. @@ -70,7 +70,7 @@ public: * Returns the duration waited for the ReadConcern to be satisfied. * Returns 0 if didWait is false. */ - stdx::chrono::milliseconds getDuration() const; + Milliseconds getDuration() const; /** * Returns more details about an error if it occurred. @@ -78,10 +78,10 @@ public: Status getStatus() const; private: - ReadConcernResponse(Status status, stdx::chrono::milliseconds duration, bool waited); + ReadConcernResponse(Status status, Milliseconds duration, bool waited); bool _waited; - stdx::chrono::milliseconds _duration = stdx::chrono::milliseconds(0); + Milliseconds _duration = Milliseconds(0); Status _status; }; diff --git a/src/mongo/db/repl/read_concern_response_test.cpp b/src/mongo/db/repl/read_concern_response_test.cpp index 4035e47af2b..5cc05ef6868 100644 --- a/src/mongo/db/repl/read_concern_response_test.cpp +++ b/src/mongo/db/repl/read_concern_response_test.cpp @@ -61,8 +61,7 @@ TEST(ReadAfterResponse, WithStatus) { } TEST(ReadAfterResponse, WaitedWithDuration) { - ReadConcernResponse response(Status(ErrorCodes::InternalError, "test"), - stdx::chrono::milliseconds(7)); + ReadConcernResponse response(Status(ErrorCodes::InternalError, "test"), Milliseconds(7)); ASSERT_TRUE(response.didWait()); ASSERT_EQUALS(Milliseconds(7), response.getDuration()); |