mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
e419dd2799
Summary: DurationScope has a pair of atomic reference count operations at the beginning and end of every recorded duration. To avoid that overhead, reference EdenStats with RefPtr and, in production EdenFS, store a global, unowned EdenStats object. This gives us the benefits of explicit dependencies and no global state in tests, while avoiding atomic RMWs in the release build. Reviewed By: xavierd Differential Revision: D44323723 fbshipit-source-id: 1b3384d2e6a0a2959fd79774a8ba46afc4c176ca
33 lines
668 B
C++
33 lines
668 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "eden/fs/utils/RefPtr.h"
|
|
|
|
namespace facebook::eden {
|
|
|
|
class EdenConfig;
|
|
class StructuredLogger;
|
|
class EdenStats;
|
|
struct SessionInfo;
|
|
|
|
using EdenStatsPtr = RefPtr<EdenStats>;
|
|
|
|
/**
|
|
* Returns a StructuredLogger appropriate for this platform and Eden
|
|
* configuration.
|
|
*/
|
|
std::shared_ptr<StructuredLogger> makeDefaultStructuredLogger(
|
|
const EdenConfig&,
|
|
SessionInfo sessionInfo,
|
|
EdenStatsPtr edenStats);
|
|
|
|
} // namespace facebook::eden
|