store: reduce verbosity of tree fetching

Summary:
Our logs are filled with this message, making it almost impossible to read,
this doesn't need to be DBG1, let's reduce it to DBG5 similarly to what we do
for blobs.

Reviewed By: kmancini

Differential Revision: D27652526

fbshipit-source-id: c61d502a9f17d8180bad857ff6c1a9033763947d
This commit is contained in:
Xavier Deguillard 2021-04-08 18:55:09 -07:00 committed by Facebook GitHub Bot
parent 8e8aaa61d6
commit 4f999f5daf
2 changed files with 16 additions and 2 deletions

View File

@ -335,8 +335,18 @@ std::unique_ptr<IOBuf> HgImporter::fetchTree(
RelativePathPiece path,
Hash pathManifestNode) {
// Ask the hg_import_helper script to fetch data for this tree
XLOG(DBG1) << "fetching data for tree \"" << path << "\" at manifest node "
<< pathManifestNode;
static constexpr auto getNumRequestsSinceLastLog =
[](uint64_t& treeRequestsSinceLog) {
uint64_t numRequests = 0;
std::swap(numRequests, treeRequestsSinceLog);
return numRequests;
};
XLOG_EVERY_MS(DBG1, 1000)
<< "fetching data for tree \"" << path << "\" at manifest node "
<< pathManifestNode << ". "
<< getNumRequestsSinceLastLog(treeRequestsSinceLog_)
<< " trees fetched since last log";
treeRequestsSinceLog_++;
auto requestID = sendFetchTreeRequest(
CMD_CAT_TREE, path, pathManifestNode, "CMD_CAT_TREE");

View File

@ -265,6 +265,10 @@ class HgImporter : public Importer {
std::shared_ptr<EdenStats> const stats_;
ImporterOptions options_;
uint32_t nextRequestID_{0};
// How many trees were fetched since the last time we logged?
uint64_t treeRequestsSinceLog_{0};
/**
* The input and output file descriptors to the helper subprocess.
*/