File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 26
26
#include " cachelib/allocator/ICompactCache.h"
27
27
#include " cachelib/allocator/memory/MemoryAllocator.h"
28
28
#include " cachelib/common/Hash.h"
29
+ #include " cachelib/common/Utils.h"
29
30
30
31
namespace facebook {
31
32
namespace cachelib {
@@ -194,8 +195,7 @@ class CacheBase {
194
195
virtual const ICompactCache& getCompactCache (PoolId pid) const = 0;
195
196
196
197
// return object cache stats
197
- virtual void getObjectCacheCounters (
198
- std::function<void (folly::StringPiece, uint64_t )>) const {}
198
+ virtual void getObjectCacheCounters (const util::CounterVisitor&) const {}
199
199
200
200
protected:
201
201
// move bytes from one pool to another. The source pool should be at least
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ void ObjectCache<AllocatorT>::remove(folly::StringPiece key) {
313
313
314
314
template <typename AllocatorT>
315
315
void ObjectCache<AllocatorT>::getObjectCacheCounters(
316
- std::function< void (folly::StringPiece, uint64_t )> visitor) const {
316
+ const util::CounterVisitor& visitor) const {
317
317
visitor (" objcache.lookups" , lookups_.get ());
318
318
visitor (" objcache.lookups.l1_hits" , succL1Lookups_.get ());
319
319
visitor (" objcache.inserts" , inserts_.get ());
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ class ObjectCache : public ObjectCacheBase<AllocatorT> {
206
206
// @param visitor callback that will be invoked with
207
207
// {stat-name, value} for each stat
208
208
void getObjectCacheCounters (
209
- std::function< void (folly::StringPiece, uint64_t )> visitor) const override ;
209
+ const util::CounterVisitor& visitor) const override ;
210
210
211
211
// Return the number of objects in cache
212
212
uint64_t getNumEntries () const {
You can’t perform that action at this time.
0 commit comments