From 14d3b48316f6e2ed075d01c3a9e7dcb28c0f2b63 Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Thu, 16 Apr 2015 17:32:06 -0400 Subject: SERVER-17817 SERVER-17894 Make Top a decoration on ServiceContext --- src/mongo/db/curop.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/curop.cpp') diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index 46b4e336cbf..06c86a71941 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -39,6 +39,7 @@ #include "mongo/db/commands.h" #include "mongo/db/commands/server_status_metric.h" #include "mongo/db/json.h" +#include "mongo/db/service_context.h" #include "mongo/db/stats/top.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" @@ -244,7 +245,8 @@ namespace mongo { void CurOp::recordGlobalTime(bool isWriteLocked, long long micros) const { string nsStr = _ns.toString(); - Top::global.record(nsStr, _op, isWriteLocked ? 1 : -1, micros, _isCommand); + int lockType = isWriteLocked ? 1 : -1; + Top::get(getGlobalServiceContext()).record(nsStr, _op, lockType, micros, _isCommand); } void CurOp::reportState(BSONObjBuilder* builder) { -- cgit v1.2.1