mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
3827b9787d
Summary: Having the type of data fetched can help in debugging where these fetches are comming from. In the currently logs figuring out if a data fetch is blob or tree requires some manual work. When looking at a big bunch of fetches this is not super practical. So this includes this info in our logging. Reviewed By: chadaustin Differential Revision: D23243444 fbshipit-source-id: 9abe5180c5d2afc0d02b27ba6a6b76401e86556e
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <folly/Executor.h>
|
|
#include <string>
|
|
|
|
#include "eden/fs/store/ObjectFetchContext.h"
|
|
#include "eden/fs/utils/PathFuncs.h"
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
class UnboundedQueueExecutor;
|
|
class StructuredLogger;
|
|
class ProcessNameCache;
|
|
|
|
class BackingStoreLogger {
|
|
public:
|
|
BackingStoreLogger(
|
|
std::shared_ptr<StructuredLogger> logger,
|
|
std::shared_ptr<ProcessNameCache> processNameCache);
|
|
|
|
// for unit tests so that a no-op logger can be passed into the backing store
|
|
BackingStoreLogger() = default;
|
|
|
|
void logImport(
|
|
ObjectFetchContext& context,
|
|
RelativePathPiece importPath,
|
|
ObjectFetchContext::ObjectType fetchedType);
|
|
|
|
private:
|
|
std::shared_ptr<StructuredLogger> logger_;
|
|
std::shared_ptr<ProcessNameCache> processNameCache_;
|
|
|
|
// for unit tests so that a no-op logger can be passed into the backing store
|
|
bool loggingAvailable_ = false;
|
|
};
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|