summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/profile_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/profile_common.cpp')
-rw-r--r--src/mongo/db/commands/profile_common.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/db/commands/profile_common.cpp b/src/mongo/db/commands/profile_common.cpp
index 625fae83723..7057dba6c2e 100644
--- a/src/mongo/db/commands/profile_common.cpp
+++ b/src/mongo/db/commands/profile_common.cpp
@@ -81,9 +81,11 @@ bool ProfileCmdBase::run(OperationContext* opCtx,
*sampleRate >= 0.0 && *sampleRate <= 1.0);
}
- // Delegate to _applyProfilingLevel to set the profiling level appropriately whether we are on
- // mongoD or mongoS.
- auto oldSettings = _applyProfilingLevel(opCtx, dbName, request);
+ // TODO SERVER-66561: For _applyProfilingLevel, takes the passed in "const DatabaseName& dbName"
+ // directly.
+ // Delegate to _applyProfilingLevel to set the profiling level appropriately whether
+ // we are on mongoD or mongoS.
+ auto oldSettings = _applyProfilingLevel(opCtx, {boost::none, dbName}, request);
auto oldSlowMS = serverGlobalParams.slowMS;
auto oldSampleRate = serverGlobalParams.sampleRate;
@@ -122,10 +124,14 @@ bool ProfileCmdBase::run(OperationContext* opCtx,
}
attrs.add("from", oldState.obj());
+ // TODO SERVER-66561: For getDatabaseProfileSettings, takes the passed in "const
+ // DatabaseName& dbName" directly.
+
// newSettings.level may differ from profilingLevel: profilingLevel is part of the request,
// and if the request specifies {profile: -1, ...} then we want to show the unchanged value
// (0, 1, or 2).
- auto newSettings = CollectionCatalog::get(opCtx)->getDatabaseProfileSettings(dbName);
+ auto newSettings =
+ CollectionCatalog::get(opCtx)->getDatabaseProfileSettings({boost::none, dbName});
newState.append("level"_sd, newSettings.level);
newState.append("slowms"_sd, serverGlobalParams.slowMS);
newState.append("sampleRate"_sd, serverGlobalParams.sampleRate);