diff options
Diffstat (limited to 'src/mongo/db/repl/replication_info.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_info.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index a5303072fbd..fe843605d10 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -126,8 +126,9 @@ namespace repl { Query().sort( BSON( "$natural" << -1 ) ) ); bb.appendDate( "masterFirst" , first["ts"].timestampTime() ); bb.appendDate( "masterLast" , last["ts"].timestampTime() ); - double lag = (double) (last["ts"].timestampTime() - s["syncedTo"].timestampTime()); - bb.append( "lagSeconds" , lag / 1000 ); + const auto lag = + (last["ts"].timestampTime() - s["syncedTo"].timestampTime()); + bb.append("lagSeconds", durationCount<Milliseconds>(lag) / 1000.0); } conn.done(); } |