Skip to content

Commit

Permalink
make hg tracebus size configurable with EdenConfig
Browse files Browse the repository at this point in the history
Summary: make hg tracebus size configurable with EdenConfig

Reviewed By: kmancini

Differential Revision: D45256093

fbshipit-source-id: 20761aed368eb4cdecf4e116a3d3406cb83608c1
  • Loading branch information
Revathy Kasipandian authored and facebook-github-bot committed Apr 26, 2023
1 parent 3c4b3f7 commit 7ea1f24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions eden/fs/config/EdenConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,11 @@ class EdenConfig : private ConfigSettingManager {
25000,
this};

ConfigSetting<size_t> HgTraceBusCapacity{
"telemetry:hg-tracebus-capacity",
100000,
this};

/**
* Controls whether EdenFS logs inode state changes to Tracebus or not.
*/
Expand Down
10 changes: 3 additions & 7 deletions eden/fs/store/hg/HgQueuedBackingStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@
namespace facebook::eden {

namespace {
// 100,000 hg object fetches in a short term is plausible.
constexpr size_t kTraceBusCapacity = 100000;
static_assert(CheckSize<HgImportTraceEvent, 64>());
// TraceBus is double-buffered, so the following capacity should be doubled.
// 10 MB overhead per backing repo is tolerable.
static_assert(
CheckEqual<6400000, kTraceBusCapacity * sizeof(HgImportTraceEvent)>());
} // namespace

HgImportTraceEvent::HgImportTraceEvent(
Expand Down Expand Up @@ -89,7 +83,9 @@ HgQueuedBackingStore::HgQueuedBackingStore(
logger_(std::move(logger)),
activityBuffer_{
config_->getEdenConfig()->hgActivityBufferSize.getValue()},
traceBus_{TraceBus<HgImportTraceEvent>::create("hg", kTraceBusCapacity)} {
traceBus_{TraceBus<HgImportTraceEvent>::create(
"hg",
config_->getEdenConfig()->HgTraceBusCapacity.getValue())} {
uint8_t numberThreads =
config_->getEdenConfig()->numBackingstoreThreads.getValue();
if (!numberThreads) {
Expand Down

0 comments on commit 7ea1f24

Please sign in to comment.