-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scmstore: use "metrics" crate to manage fetch metrics
Summary: Completely rework how we handle counters during the "fetch" codepaths of the scmstore FileStore and TreeStore. These are the goals: 1. Avoid having to allocate Strings related to metrics more than once. Currently we allocate a bunch of metrics strings (multiple times) whenever we flush metrics to Sapling's metrics store or ODS. 2. Consolidate ODS counter propagation into a reusable crate: the "metrics" crate. Now there is no special code needed to send counters to ODS (via EdenFS) - just make a Counter and increment it. 3. Transition to more of a "normal" counter approach where counters are essentially global atomic counters that get incremented immediately (and then collected from some outside process intermittently). I achieved the goals, but I had to use some macros to bridge the gap between static global counters and the current heavily factored metrics collection of scmstore. Basically, I re-used the existing metrics structs, but made them `'static`, containing shared `'static` counters. This also addresses the "gotcha" I introduced in D66731805 where scmstore counters in EdenFS aren't up-to-date until the scmstores are flushed (now they are immediately up to date). Note that I did not update the "write" and "api" sets of metrics for FileStore. These are less important and are fine to leave as-is for now. Reviewed By: quark-zju Differential Revision: D66848951 fbshipit-source-id: 289b8d39eb74a4f06a7abaf0b74fa10d2cb75665
- Loading branch information
1 parent
cba4249
commit 79c30a5
Showing
13 changed files
with
225 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.