diff options
author | Tad Marshall <tad@10gen.com> | 2012-11-18 12:38:16 -0500 |
---|---|---|
committer | Tad Marshall <tad@10gen.com> | 2012-11-18 12:38:16 -0500 |
commit | 39ccb23eaf656640fe3def564c47ebbcaa003b11 (patch) | |
tree | 2dd5f31fcf3fd70c01e08d3833390ecf3f7b3148 | |
parent | 7c8dec9a7bff471724c9cf9941650462a11bd983 (diff) | |
download | mongo-39ccb23eaf656640fe3def564c47ebbcaa003b11.tar.gz |
Revert "SERVER-7700 Use high-resolution program uptime to track socket connection time"
This reverts commit 7c8dec9a7bff471724c9cf9941650462a11bd983.
-rw-r--r-- | src/mongo/client/scoped_db_conn_test.cpp | 6 | ||||
-rw-r--r-- | src/mongo/util/net/sock.cpp | 3 | ||||
-rw-r--r-- | src/mongo/util/timer.cpp | 13 | ||||
-rw-r--r-- | src/mongo/util/timer.h | 6 |
4 files changed, 4 insertions, 24 deletions
diff --git a/src/mongo/client/scoped_db_conn_test.cpp b/src/mongo/client/scoped_db_conn_test.cpp index 5a299a1ba25..beabd37d0b5 100644 --- a/src/mongo/client/scoped_db_conn_test.cpp +++ b/src/mongo/client/scoped_db_conn_test.cpp @@ -235,7 +235,7 @@ namespace mongo_test { newConnList.push_back(newConn); } - const uint64_t oldCreationTime = mongo::getProgramUptimeMicros(); + const uint64_t oldCreationTime = mongo::curTimeMicros64(); for (vector<ScopedDbConnection*>::iterator iter = newConnList.begin(); iter != newConnList.end(); ++iter) { @@ -297,7 +297,7 @@ namespace mongo_test { conn1->done(); conn3->done(); - const uint64_t badCreationTime = mongo::getProgramUptimeMicros(); + const uint64_t badCreationTime = mongo::curTimeMicros64(); mongo::getGlobalFailPointRegistry()->getFailPoint("throwSockExcep")-> setMode(FailPoint::alwaysOn); @@ -358,7 +358,7 @@ namespace mongo_test { conn1->done(); conn3->done(); - const uint64_t badCreationTime = mongo::getProgramUptimeMicros(); + const uint64_t badCreationTime = mongo::curTimeMicros64(); mongo::getGlobalFailPointRegistry()->getFailPoint("throwSockExcep")-> setMode(FailPoint::alwaysOn); diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index 768a8b4165f..1547b95073e 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -42,7 +42,6 @@ #include "mongo/util/concurrency/value.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/mongoutils/str.h" -#include "mongo/util/timer.h" #include "mongo/db/cmdline.h" namespace mongo { @@ -481,7 +480,7 @@ namespace mongo { setsockopt( _fd , SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(int)); #endif - _fdCreationMicroSec = getProgramUptimeMicros(); + _fdCreationMicroSec = curTimeMicros64(); return true; } diff --git a/src/mongo/util/timer.cpp b/src/mongo/util/timer.cpp index a7d1e7cd0f5..1d399b61c53 100644 --- a/src/mongo/util/timer.cpp +++ b/src/mongo/util/timer.cpp @@ -19,8 +19,6 @@ #include <limits> -#include "mongo/base/init.h" - namespace mongo { unsigned long long Timer::_countsPerSecond; @@ -65,17 +63,6 @@ namespace mongo { #error "Unknown mongo::Timer implementation" #endif - Timer* programUptimeTimer = NULL; - - MONGO_INITIALIZER(ProgramUptimeTimer)(InitializerContext* context) { - programUptimeTimer = new Timer(); - return Status::OK(); - } - } // namespace - unsigned long long getProgramUptimeMicros() { - return programUptimeTimer->micros(); - } - } // namespace mongo diff --git a/src/mongo/util/timer.h b/src/mongo/util/timer.h index 3368c93252b..12a19674b24 100644 --- a/src/mongo/util/timer.h +++ b/src/mongo/util/timer.h @@ -75,12 +75,6 @@ namespace mongo { unsigned long long _old; }; - - /** Get this program's approximate uptime in microseconds. - * @return uptime in microseconds. - */ - extern unsigned long long getProgramUptimeMicros(); - } // namespace mongo #include "mongo/util/timer-inl.h" |