mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
Add new InodeMap metrics
Summary: InodeMap, in subsequent diffs, will report metrics when looking up inodes (hits, misses, errors). Adding a new stats subtype with counters for this purpose. Reviewed By: chadaustin Differential Revision: D49477890 fbshipit-source-id: 18386cd18e83da57053f39f6eea2966de48dbfb5
This commit is contained in:
parent
5632c1a87f
commit
3be15e3b69
@ -29,6 +29,7 @@ struct JournalStats;
|
||||
struct ThriftStats;
|
||||
struct TelemetryStats;
|
||||
struct OverlayStats;
|
||||
struct InodeMapStats;
|
||||
|
||||
/**
|
||||
* StatsGroupBase is a base class for a group of thread-local stats
|
||||
@ -124,6 +125,7 @@ class EdenStats : public RefCounted {
|
||||
ThreadLocal<ThriftStats> thriftStats_;
|
||||
ThreadLocal<TelemetryStats> telemetryStats_;
|
||||
ThreadLocal<OverlayStats> overlayStats_;
|
||||
ThreadLocal<InodeMapStats> inodeMapStats_;
|
||||
};
|
||||
|
||||
using EdenStatsPtr = RefPtr<EdenStats>;
|
||||
@ -185,6 +187,11 @@ inline OverlayStats& EdenStats::getStatsForCurrentThread<OverlayStats>() {
|
||||
return *overlayStats_.get();
|
||||
}
|
||||
|
||||
template <>
|
||||
inline InodeMapStats& EdenStats::getStatsForCurrentThread<InodeMapStats>() {
|
||||
return *inodeMapStats_.get();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
class StatsGroup : public StatsGroupBase {
|
||||
public:
|
||||
@ -384,6 +391,14 @@ struct OverlayStats : StatsGroup<OverlayStats> {
|
||||
Duration renameChild{"overlay.rename_child_us"};
|
||||
};
|
||||
|
||||
struct InodeMapStats : StatsGroup<InodeMapStats> {
|
||||
Counter lookupTreeInodeHit{"inode_map.lookup_tree_inode_hit"};
|
||||
Counter lookupBlobInodeHit{"inode_map.lookup_blob_inode_hit"};
|
||||
Counter lookupTreeInodeMiss{"inode_map.lookup_tree_inode_miss"};
|
||||
Counter lookupBlobInodeMiss{"inode_map.lookup_blob_inode_miss"};
|
||||
Counter lookupInodeError{"inode_map.lookup_inode_error"};
|
||||
};
|
||||
|
||||
/**
|
||||
* On construction, notes the current time. On destruction, records the elapsed
|
||||
* time in the specified EdenStats Duration.
|
||||
|
Loading…
Reference in New Issue
Block a user