17 #ifndef NET_INSTAWEB_SYSTEM_PUBLIC_SYSTEM_SERVER_CONTEXT_H_
18 #define NET_INSTAWEB_SYSTEM_PUBLIC_SYSTEM_SERVER_CONTEXT_H_
26 #include "pagespeed/kernel/base/string_util.h"
27 #include "pagespeed/kernel/base/string.h"
28 #include "pagespeed/kernel/util/copy_on_write.h"
30 namespace net_instaweb {
39 class RewriteDriverFactory;
42 class SharedMemStatistics;
44 class SystemCachePath;
46 class SystemRewriteDriverFactory;
47 class SystemRewriteOptions;
49 class UrlAsyncFetcherStats;
80 GoogleString hostname_identifier() {
return hostname_identifier_; }
89 static void InitStats(Statistics* statistics);
138 const QueryParams& query_params, AsyncFetch* fetch);
151 void AdminPage(
bool is_global,
const GoogleUrl& stripped_gurl,
152 const QueryParams& query_params,
const RewriteOptions* options,
160 void StatisticsPage(
bool is_global,
const QueryParams& query_params,
161 const RewriteOptions* options,
164 AdminSite* admin_site() {
return admin_site_.get(); }
211 const GoogleUrl& stripped_gurl,
212 const QueryParams& query_params,
221 Variable* statistics_404_count();
233 void CheckLegacyGlobalCacheFlushFile();
235 scoped_ptr<AdminSite> admin_site_;
238 bool use_per_vhost_statistics_;
243 scoped_ptr<AbstractMutex> cache_flush_mutex_;
244 int64 last_cache_flush_check_sec_;
246 Variable* cache_flush_count_;
247 UpDownCounter* cache_flush_timestamp_ms_;
249 Histogram* html_rewrite_time_us_histogram_;
252 scoped_ptr<Statistics> split_statistics_;
255 SharedMemStatistics* local_statistics_;
258 scoped_ptr<RewriteStats> local_rewrite_stats_;
259 scoped_ptr<UrlAsyncFetcherStats> stats_fetcher_;
264 GoogleString hostname_identifier_;
virtual void MaybeApplySpdySessionFetcher(const RequestContextPtr &request, RewriteDriver *driver)
Hook for implementations to support fetching directly from the spdy module.
Definition: system_server_context.h:182
void UpdateCachePurgeSet(const CopyOnWrite< PurgeSet > &purge_set)
void MessageHistoryHandler(const RewriteOptions &options, AdminSite::AdminSource source, AsyncFetch *fetch)
Displays recent Info/Warning/Error messages.
SystemServerContext(RewriteDriverFactory *factory, StringPiece hostname, int port)
virtual const SystemRewriteOptions * SpdyGlobalConfig() const
virtual void CollapseConfigOverlaysAndComputeSignatures()
void ConsoleJsonHandler(const QueryParams ¶ms, AsyncFetch *fetch)
Returns JSON used by the PageSpeed Console JavaScript.
void AddHtmlRewriteTimeUs(int64 rewrite_time_us)
void AdminPage(bool is_global, const GoogleUrl &stripped_gurl, const QueryParams &query_params, const RewriteOptions *options, AsyncFetch *fetch)
A server context with features specific to a psol port on a unix system.
Definition: system_rewrite_driver_factory.h:54
void StatisticsPage(bool is_global, const QueryParams &query_params, const RewriteOptions *options, AsyncFetch *fetch)
virtual bool UpdateCacheFlushTimestampMs(int64 timestamp_ms)
Definition: system_rewrite_options.h:31
void CreateLocalStatistics(Statistics *global_statistics, SystemRewriteDriverFactory *factory)
void PrintSpdyConfig(AdminSite::AdminSource source, AsyncFetch *fetch)
Print details fo the SPDY configuration.
void PrintCaches(bool is_global, AdminSite::AdminSource source, const GoogleUrl &stripped_gurl, const QueryParams &query_params, const RewriteOptions *options, AsyncFetch *fetch)
Definition: async_fetch.h:53
void FlushCacheIfNecessary()
bool initialized() const
Definition: system_server_context.h:102
Definition: system_caches.h:59
Definition: rewrite_driver.h:98
void StatisticsGraphsHandler(Writer *writer)
Deprecated handler for graphs in the PSOL console.
Definition: server_context.h:100
A server context with features specific to a PSOL port on a unix system.
Definition: system_server_context.h:54
void PrintHistograms(bool is_global_request, AdminSite::AdminSource source, AsyncFetch *fetch)
Print histograms showing the dynamics of server activity.
AdminSource
Definition: admin_site.h:52
const GoogleString & hostname() const
Returns the current server hostname.
Definition: server_context.h:579
virtual void PostInitHook()
Initialize this SystemServerContext to set up its admin site.
void ConsoleHandler(const SystemRewriteOptions &options, AdminSite::AdminSource source, const QueryParams &query_params, AsyncFetch *fetch)
virtual void ApplySessionFetchers(const RequestContextPtr &req, RewriteDriver *driver)
Definition: rewrite_options.h:81
Definition: system_cache_path.h:49
virtual void ChildInit(SystemRewriteDriverFactory *factory)
Called by SystemRewriteDriverFactory::ChildInit. See documentation there.
void StatisticsHandler(const RewriteOptions &options, bool is_global_request, AdminSite::AdminSource source, AsyncFetch *fetch)
void PrintNormalConfig(AdminSite::AdminSource source, AsyncFetch *fetch)
Print details fo the non-SPDY configuration.
Definition: rewrite_driver_factory.h:73