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 2626#include " cachelib/allocator/ICompactCache.h"
2727#include " cachelib/allocator/memory/MemoryAllocator.h"
2828#include " cachelib/common/Hash.h"
29+ #include " cachelib/common/Utils.h"
2930
3031namespace facebook {
3132namespace cachelib {
@@ -194,8 +195,7 @@ class CacheBase {
194195 virtual const ICompactCache& getCompactCache (PoolId pid) const = 0;
195196
196197 // 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 {}
199199
200200 protected:
201201 // 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) {
313313
314314template <typename AllocatorT>
315315void ObjectCache<AllocatorT>::getObjectCacheCounters(
316- std::function< void (folly::StringPiece, uint64_t )> visitor) const {
316+ const util::CounterVisitor& visitor) const {
317317 visitor (" objcache.lookups" , lookups_.get ());
318318 visitor (" objcache.lookups.l1_hits" , succL1Lookups_.get ());
319319 visitor (" objcache.inserts" , inserts_.get ());
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ class ObjectCache : public ObjectCacheBase<AllocatorT> {
206206 // @param visitor callback that will be invoked with
207207 // {stat-name, value} for each stat
208208 void getObjectCacheCounters (
209- std::function< void (folly::StringPiece, uint64_t )> visitor) const override ;
209+ const util::CounterVisitor& visitor) const override ;
210210
211211 // Return the number of objects in cache
212212 uint64_t getNumEntries () const {
You can’t perform that action at this time.
0 commit comments