Skip to content

Commit 614657f

Browse files
committed
MB-68795: Log time spent in DeleteFusionNamespace
Unfortunately, magma/fusion does not have a global logger. Their loggers are tied to a bucket instance. Fortunately, KV does have one. This patch captures the time spent in DeleteFusionNamespace call to track how long S3 takes to clear away all the log files. Change-Id: Ie7622b5a0b34d2e87c4a71c7aad62addb182bb30 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/235319 Tested-by: Build Bot <[email protected]> Reviewed-by: Rohan Suri <[email protected]> Reviewed-by: Trond Norbye <[email protected]>
1 parent 478722c commit 614657f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

daemon/protocol/mcbp/delete_fusion_namespace_command_context.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,23 @@ cb::engine_errc DeleteFusionNamespaceCommandContext::execute() {
3232
const auto metadatastore = request["metadatastore_uri"];
3333
const auto token = request["metadatastore_auth_token"];
3434
const auto ns = request["namespace"];
35+
const auto start = std::chrono::steady_clock::now();
3536
const auto status = magma::Magma::DeleteFusionNamespace(
3637
logstore, metadatastore, token, ns);
38+
const auto stop = std::chrono::steady_clock::now();
3739
if (status.IsOK()) {
40+
LOG_INFO_CTX("DeleteFusionNamespace",
41+
{"logstore_uri", logstore},
42+
{"metadatastore_uri", metadatastore},
43+
{"namespace", ns},
44+
{"duration", stop - start});
3845
return cb::engine_errc::success;
3946
}
4047
LOG_WARNING_CTX("DeleteFusionNamespace",
4148
{"logstore_uri", logstore},
4249
{"metadatastore_uri", metadatastore},
4350
{"namespace", ns},
44-
{"error", status.String()});
51+
{"error", status.String()},
52+
{"duration", stop - start});
4553
return cb::engine_errc::failed;
4654
}

0 commit comments

Comments
 (0)