summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Cooper <adam.cooper@mongodb.com>2020-03-02 14:41:51 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-04 17:23:05 +0000
commitfdb12065e79cd46bd0dae0f93ccd682dfeff120c (patch)
treed55bd6a0bc2705a1d3f1253a47ebbe87c0ce1a0d
parent7f58f61efba671e44f25813cd105427e35cf6120 (diff)
downloadmongo-fdb12065e79cd46bd0dae0f93ccd682dfeff120c.tar.gz
SERVER-46530 Review and convert LogV2 statements in FTDC
-rw-r--r--src/mongo/db/ftdc/controller.cpp8
-rw-r--r--src/mongo/db/ftdc/file_manager.cpp22
-rw-r--r--src/mongo/db/ftdc/file_manager_test.cpp6
-rw-r--r--src/mongo/db/ftdc/ftdc_system_stats_windows.cpp4
-rw-r--r--src/mongo/db/ftdc/util.cpp33
5 files changed, 29 insertions, 44 deletions
diff --git a/src/mongo/db/ftdc/controller.cpp b/src/mongo/db/ftdc/controller.cpp
index 6da89b00104..a9f68714789 100644
--- a/src/mongo/db/ftdc/controller.cpp
+++ b/src/mongo/db/ftdc/controller.cpp
@@ -138,8 +138,8 @@ BSONObj FTDCController::getMostRecentPeriodicDocument() {
void FTDCController::start() {
LOGV2(20625,
- "Initializing full-time diagnostic data capture with directory '{path_generic_string}'",
- "path_generic_string"_attr = _path.generic_string());
+ "Initializing full-time diagnostic data capture",
+ "dataDirectory"_attr = _path.generic_string());
// Start the thread
_thread = stdx::thread([this] { doLoop(); });
@@ -182,8 +182,8 @@ void FTDCController::stop() {
auto s = _mgr->close();
if (!s.isOK()) {
LOGV2(20627,
- "Failed to close full-time diagnostic data capture file manager: {s}",
- "s"_attr = s);
+ "Failed to close full-time diagnostic data capture file manager",
+ "status"_attr = s);
}
}
}
diff --git a/src/mongo/db/ftdc/file_manager.cpp b/src/mongo/db/ftdc/file_manager.cpp
index dbe83579f4b..801bf9aafd0 100644
--- a/src/mongo/db/ftdc/file_manager.cpp
+++ b/src/mongo/db/ftdc/file_manager.cpp
@@ -229,9 +229,8 @@ Status FTDCFileManager::trimDirectory(std::vector<boost::filesystem::path>& file
if (size >= maxSize) {
LOGV2_DEBUG(20628,
1,
- "Cleaning file over full-time diagnostic data capture quota, file: "
- "{it_generic_string} with size {fileSize}",
- "it_generic_string"_attr = (*it).generic_string(),
+ "Cleaning file over full-time diagnostic data capture quota",
+ "fileName"_attr = (*it).generic_string(),
"fileSize"_attr = fileSize);
boost::filesystem::remove(*it, ec);
@@ -262,8 +261,8 @@ FTDCFileManager::recoverInterimFile() {
size_t size = boost::filesystem::file_size(interimFile, ec);
if (ec) {
LOGV2(20629,
- "Recover interim file failed as the file size could not be checked: {ec_message}",
- "ec_message"_attr = ec.message());
+ "Recover interim file failed as the file size could not be checked",
+ "errorMessage"_attr = ec.message());
return docs;
}
@@ -275,11 +274,9 @@ FTDCFileManager::recoverInterimFile() {
auto s = read.open(interimFile);
if (!s.isOK()) {
LOGV2(20630,
- "Unclean full-time diagnostic data capture shutdown detected, found interim file, "
- "but failed "
- "to open it, some "
- "metrics may have been lost. {s}",
- "s"_attr = s);
+ "Unclean full-time diagnostic data capture shutdown detected, found interim file, "
+ "but failed to open it, some metrics may have been lost",
+ "status"_attr = s);
// Note: We ignore any actual errors as reading from the interim files is a best-effort
return docs;
@@ -296,9 +293,8 @@ FTDCFileManager::recoverInterimFile() {
if (!m.isOK() || !docs.empty()) {
LOGV2(20631,
"Unclean full-time diagnostic data capture shutdown detected, found interim file, "
- "some "
- "metrics may have been lost. {m_getStatus}",
- "m_getStatus"_attr = m.getStatus());
+ "some metrics may have been lost",
+ "status"_attr = m.getStatus());
}
// Note: We ignore any actual errors as reading from the interim files is a best-effort
diff --git a/src/mongo/db/ftdc/file_manager_test.cpp b/src/mongo/db/ftdc/file_manager_test.cpp
index 0f48f795973..bb059fdf341 100644
--- a/src/mongo/db/ftdc/file_manager_test.cpp
+++ b/src/mongo/db/ftdc/file_manager_test.cpp
@@ -115,9 +115,9 @@ TEST_F(FTDCFileManagerTest, TestFull) {
int fs = boost::filesystem::file_size(file);
ASSERT_TRUE(fs < c.maxFileSizeBytes * 1.10);
LOGV2(20632,
- "File {file_generic_string} has size {fs}",
- "file_generic_string"_attr = file.generic_string(),
- "fs"_attr = fs);
+ "File {fileName} has size {fileSize}",
+ "fileName"_attr = file.generic_string(),
+ "fileSize"_attr = fs);
if (file.generic_string().find("interim") == std::string::npos) {
sum += fs;
}
diff --git a/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp b/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp
index 7b923f2465d..07fff29ffc2 100644
--- a/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp
+++ b/src/mongo/db/ftdc/ftdc_system_stats_windows.cpp
@@ -145,8 +145,8 @@ void installSystemMetricsCollector(FTDCController* controller) {
auto swCollector = createCollector();
if (!swCollector.getStatus().isOK()) {
LOGV2_WARNING(23718,
- "Failed to initialize Performance Counters for FTDC: {swCollector_getStatus}",
- "swCollector_getStatus"_attr = swCollector.getStatus());
+ "Failed to initialize Performance Counters for FTDC",
+ "status"_attr = swCollector.getStatus());
return;
}
diff --git a/src/mongo/db/ftdc/util.cpp b/src/mongo/db/ftdc/util.cpp
index 9a9c6a7cc8a..1cea140775f 100644
--- a/src/mongo/db/ftdc/util.cpp
+++ b/src/mongo/db/ftdc/util.cpp
@@ -182,7 +182,7 @@ StatusWith<bool> extractMetricsFromDocument(const BSONObj& referenceDoc,
if (matches && !itReference.more()) {
LOGV2_DEBUG(20633,
4,
- "full-time diagnostic data capture schema change: currrent document is "
+ "full-time diagnostic data capture schema change: current document is "
"longer than reference document");
matches = false;
}
@@ -195,13 +195,9 @@ StatusWith<bool> extractMetricsFromDocument(const BSONObj& referenceDoc,
if (referenceElement.fieldNameStringData() != currentElement.fieldNameStringData()) {
LOGV2_DEBUG(20634,
4,
- "full-time diagnostic data capture schema change: field name change - "
- "from '{referenceElement_fieldNameStringData}' to "
- "'{currentElement_fieldNameStringData}'",
- "referenceElement_fieldNameStringData"_attr =
- referenceElement.fieldNameStringData(),
- "currentElement_fieldNameStringData"_attr =
- currentElement.fieldNameStringData());
+ "full-time diagnostic data capture schema change: field name change",
+ "from"_attr = referenceElement.fieldNameStringData(),
+ "to"_attr = currentElement.fieldNameStringData());
matches = false;
}
@@ -212,19 +208,12 @@ StatusWith<bool> extractMetricsFromDocument(const BSONObj& referenceDoc,
if ((currentElement.type() != referenceElement.type()) &&
!(referenceElement.isNumber() == true &&
currentElement.isNumber() == referenceElement.isNumber())) {
- LOGV2_DEBUG(
- 20635,
- 4,
- "full-time diagnostic data capture schema change: field type change for "
- "field '{referenceElement_fieldNameStringData}' from "
- "'{static_cast_int_referenceElement_type}' to "
- "'{static_cast_int_currentElement_type}'",
- "referenceElement_fieldNameStringData"_attr =
- referenceElement.fieldNameStringData(),
- "static_cast_int_referenceElement_type"_attr =
- static_cast<int>(referenceElement.type()),
- "static_cast_int_currentElement_type"_attr =
- static_cast<int>(currentElement.type()));
+ LOGV2_DEBUG(20635,
+ 4,
+ "full-time diagnostic data capture schema change: field type change",
+ "fieldName"_attr = referenceElement.fieldNameStringData(),
+ "oldType"_attr = static_cast<int>(referenceElement.type()),
+ "newType"_attr = static_cast<int>(currentElement.type()));
matches = false;
}
}
@@ -279,7 +268,7 @@ StatusWith<bool> extractMetricsFromDocument(const BSONObj& referenceDoc,
LOGV2_DEBUG(20636,
4,
"full-time diagnostic data capture schema change: reference document is longer "
- "then current");
+ "than current");
matches = false;
}