0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

change ping to pingMs

This commit is contained in:
Kristina 2011-06-09 16:16:18 -04:00
parent fcd1ff5edb
commit 1f20d1e6f8
2 changed files with 8 additions and 7 deletions

View File

@ -399,7 +399,7 @@ namespace mongo {
bb.appendTimestamp("optime", m->hbinfo().opTime.asDate());
bb.appendDate("optimeDate", m->hbinfo().opTime.getSecs() * 1000LL);
bb.appendTimeT("lastHeartbeat", m->hbinfo().lastHeartbeat);
bb.append("ping", m->hbinfo().ping);
bb.append("pingMs", m->hbinfo().ping);
string s = m->lhb();
if( !s.empty() )
bb.append("errmsg", s);
@ -410,8 +410,9 @@ namespace mongo {
b.append("set", name());
b.appendTimeT("date", time(0));
b.append("myState", box.getState().s);
if (_currentSyncTarget) {
b.append("syncingTo", _currentSyncTarget->fullName());
const Member *syncTarget = _currentSyncTarget;
if (syncTarget) {
b.append("syncingTo", syncTarget->fullName());
}
b.append("members", v);
if( replSetBlind )

View File

@ -161,14 +161,14 @@ namespace mongo {
Timer timer;
bool ok = requestHeartbeat(theReplSet->name(), theReplSet->selfFullName(), h.toString(), info, theReplSet->config().version, theirConfigVersion);
mem.ping = (unsigned int)timer.micros();
mem.ping = (unsigned int)timer.millis();
time_t before = timer.startTime() / 1000000;
// we set this on any response - we don't get this far if
// couldn't connect because exception is thrown
time_t after = mem.lastHeartbeat = before + (mem.ping / 1000000);
time_t after = mem.lastHeartbeat = before + (mem.ping / 1000);
if ( info["time"].isNumber() ) {
long long t = info["time"].numberLong();
if( t > after )