Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
admin_site.h
Go to the documentation of this file.
1 // Copyright 2013 Google Inc.
17 
18 #ifndef PAGESPEED_SYSTEM_ADMIN_SITE_H_
19 #define PAGESPEED_SYSTEM_ADMIN_SITE_H_
20 
23 
24 namespace net_instaweb {
25 
26 class AsyncFetch;
27 class CacheInterface;
28 class GoogleUrl;
29 class HTTPCache;
30 class MessageHandler;
31 class PropertyCache;
32 class QueryParams;
33 class RewriteOptions;
34 class ServerContext;
35 class StaticAssetManager;
36 class Statistics;
37 class SystemCachePath;
38 class SystemCaches;
39 class SystemRewriteOptions;
40 class Timer;
41 class Writer;
42 
44 class AdminSite {
45  public:
52  enum AdminSource { kPageSpeedAdmin, kStatistics, kOther };
53 
54  AdminSite(StaticAssetManager* static_asset_manager, Timer* timer,
55  MessageHandler* message_handler);
56 
57  ~AdminSite() {
58  }
59 
62  void ConsoleHandler(const SystemRewriteOptions& global_options,
63  const RewriteOptions& options, AdminSource source,
64  const QueryParams& query_params, AsyncFetch* fetch,
65  Statistics* statistics);
66 
68  void MessageHistoryHandler(const RewriteOptions& options,
69  AdminSource source, AsyncFetch* fetch);
70 
73  Writer* writer, SystemRewriteOptions* global_system_rewrite_options);
74 
78  void AdminPage(bool is_global, const GoogleUrl& stripped_gurl,
79  const QueryParams& query_params,
80  const RewriteOptions* options,
81  SystemCachePath* cache_path,
82  AsyncFetch* fetch, SystemCaches* system_caches,
83  CacheInterface* filesystem_metadata_cache,
84  HTTPCache* http_cache, CacheInterface* metadata_cache,
85  PropertyCache* page_property_cache,
86  ServerContext* server_context, Statistics* statistics,
87  Statistics* stats,
88  SystemRewriteOptions* global_system_rewrite_options);
89 
95  void StatisticsPage(bool is_global, const QueryParams& query_params,
96  const RewriteOptions* options, AsyncFetch* fetch,
97  SystemCaches* system_caches,
98  CacheInterface* filesystem_metadata_cache,
99  HTTPCache* http_cache, CacheInterface* metadata_cache,
100  PropertyCache* page_property_cache,
101  ServerContext* server_context, Statistics* statistics,
102  Statistics* stats,
103  SystemRewriteOptions* global_system_rewrite_options);
104 
106  void ConsoleJsonHandler(const QueryParams& params, AsyncFetch* fetch,
107  Statistics* statistics);
108 
113  void StatisticsHandler(const RewriteOptions& options, AdminSource source,
114  AsyncFetch* fetch, Statistics* stats);
115 
118  void StatisticsJsonHandler(AsyncFetch* fetch, Statistics* stats);
119 
122  void GraphsHandler(const RewriteOptions& options, AdminSource source,
123  const QueryParams& query_params, AsyncFetch* fetch,
124  Statistics* stats);;
125 
127  void PrintConfig(AdminSource source, AsyncFetch* fetch,
128  SystemRewriteOptions* global_system_rewrite_options);
129 
132  void PrintCaches(bool is_global, AdminSource source,
133  const GoogleUrl& stripped_gurl,
134  const QueryParams& query_params,
135  const RewriteOptions* options,
136  SystemCachePath* cache_path,
137  AsyncFetch* fetch, SystemCaches* system_caches,
138  CacheInterface* filesystem_metadata_cache,
139  HTTPCache* http_cache, CacheInterface* metadata_cache,
140  PropertyCache* page_property_cache,
141  ServerContext* server_context);
142 
144  void PrintHistograms(AdminSource source, AsyncFetch* fetch,
145  Statistics* stats);
146 
147  void PurgeHandler(StringPiece url, SystemCachePath* cache_path,
148  AsyncFetch* fetch);
149 
151  MessageHandler* MessageHandlerForTesting() { return message_handler_; }
152 
153  private:
154  MessageHandler* message_handler_;
155  StaticAssetManager* static_asset_manager_;
156  Timer* timer_;
157 
158 };
159 
160 }
161 
162 #endif
Definition: static_asset_manager.h:48
void ConsoleJsonHandler(const QueryParams &params, AsyncFetch *fetch, Statistics *statistics)
Returns JSON used by the PageSpeed Console JavaScript.
void PrintCaches(bool is_global, AdminSource source, const GoogleUrl &stripped_gurl, const QueryParams &query_params, const RewriteOptions *options, SystemCachePath *cache_path, AsyncFetch *fetch, SystemCaches *system_caches, CacheInterface *filesystem_metadata_cache, HTTPCache *http_cache, CacheInterface *metadata_cache, PropertyCache *page_property_cache, ServerContext *server_context)
void StatisticsPage(bool is_global, const QueryParams &query_params, const RewriteOptions *options, AsyncFetch *fetch, SystemCaches *system_caches, CacheInterface *filesystem_metadata_cache, HTTPCache *http_cache, CacheInterface *metadata_cache, PropertyCache *page_property_cache, ServerContext *server_context, Statistics *statistics, Statistics *stats, SystemRewriteOptions *global_system_rewrite_options)
void MessageHistoryHandler(const RewriteOptions &options, AdminSource source, AsyncFetch *fetch)
Displays recent Info/Warning/Error messages.: public ServerContext.
void AdminPage(bool is_global, const GoogleUrl &stripped_gurl, const QueryParams &query_params, const RewriteOptions *options, SystemCachePath *cache_path, AsyncFetch *fetch, SystemCaches *system_caches, CacheInterface *filesystem_metadata_cache, HTTPCache *http_cache, CacheInterface *metadata_cache, PropertyCache *page_property_cache, ServerContext *server_context, Statistics *statistics, Statistics *stats, SystemRewriteOptions *global_system_rewrite_options)
MessageHandler * MessageHandlerForTesting()
Return the message handler for debugging use.
Definition: admin_site.h:151
void StatisticsGraphsHandler(Writer *writer, SystemRewriteOptions *global_system_rewrite_options)
Deprecated handler for graphs in the PSOL console.
void GraphsHandler(const RewriteOptions &options, AdminSource source, const QueryParams &query_params, AsyncFetch *fetch, Statistics *stats)
AdminSource
Definition: admin_site.h:52
Implements the /pagespeed_admin pages.
Definition: admin_site.h:44
void PrintHistograms(AdminSource source, AsyncFetch *fetch, Statistics *stats)
Print histograms showing the dynamics of server activity.
void PrintConfig(AdminSource source, AsyncFetch *fetch, SystemRewriteOptions *global_system_rewrite_options)
Print details for configuration.
Definition: message_handler.h:39
void ConsoleHandler(const SystemRewriteOptions &global_options, const RewriteOptions &options, AdminSource source, const QueryParams &query_params, AsyncFetch *fetch, Statistics *statistics)
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
void StatisticsHandler(const RewriteOptions &options, AdminSource source, AsyncFetch *fetch, Statistics *stats)
void StatisticsJsonHandler(AsyncFetch *fetch, Statistics *stats)