19 #ifndef PAGESPEED_KERNEL_CACHE_CACHE_STATS_H_
20 #define PAGESPEED_KERNEL_CACHE_CACHE_STATS_H_
27 #include "pagespeed/kernel/cache/cache_interface.h"
29 namespace net_instaweb {
53 virtual void MultiGet(MultiGetRequest* request);
60 return !shutdown_.value() && cache_->
IsHealthy();
64 shutdown_.set_value(
true);
69 return FormatName(prefix_, cache_->
Name());
71 static GoogleString FormatName(StringPiece prefix, StringPiece cache);
75 friend class StatsCallback;
Definition: atomic_bool.h:31
Abstract interface for a cache.
Definition: cache_interface.h:32
Definition: statistics.h:43
virtual bool IsHealthy() const
Definition: cache_stats.h:59
Definition: cache_stats.h:40
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
virtual CacheInterface * Backend()
Definition: cache_stats.h:56
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual bool IsHealthy() const =0
virtual bool IsBlocking() const =0
virtual void Put(const GoogleString &key, const SharedString &value)
virtual GoogleString Name() const
Definition: cache_stats.h:68
Definition: shared_string.h:40
Definition: cache_interface.h:42
Definition: statistics.h:138
virtual void ShutDown()
Definition: cache_stats.h:63
virtual void MultiGet(MultiGetRequest *request)
virtual void Get(const GoogleString &key, Callback *callback)
virtual void ShutDown()=0
virtual GoogleString Name() const =0
CacheStats(StringPiece prefix, CacheInterface *cache, Timer *timer, Statistics *statistics)
Doees not takes ownership of the cache, timer, or statistics.
static void InitStats(StringPiece prefix, Statistics *statistics)
This must be called once for every unique cache prefix.
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
virtual bool IsBlocking() const
Definition: cache_stats.h:57