Page Speed Optimization Libraries
1.5.27.2
|
00001 /* 00002 * Copyright 2011 Google Inc. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http:///www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00018 00019 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_STATS_H_ 00020 #define NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_STATS_H_ 00021 00022 #include <vector> 00023 00024 #include "net/instaweb/rewriter/public/rewrite_driver_factory.h" 00025 #include "net/instaweb/util/public/basictypes.h" 00026 00027 namespace net_instaweb { 00028 00029 class Histogram; 00030 class Statistics; 00031 class ThreadSystem; 00032 class TimedVariable; 00033 class Timer; 00034 class Variable; 00035 class Waveform; 00036 00038 class RewriteStats { 00039 public: 00040 static const char kNumResourceFetchSuccesses[]; 00041 static const char kNumResourceFetchFailures[]; 00042 00043 RewriteStats(Statistics* stats, ThreadSystem* thread_system, Timer* timer); 00044 ~RewriteStats(); 00045 00046 static void InitStats(Statistics* statistics); 00047 00048 Variable* cached_output_hits() { return cached_output_hits_; } 00049 Variable* cached_output_missed_deadline() { 00050 return cached_output_missed_deadline_; } 00051 Variable* cached_output_misses() { return cached_output_misses_; 00052 } 00053 Variable* cached_resource_fetches() { return cached_resource_fetches_; } 00054 Variable* failed_filter_resource_fetches() { 00055 return failed_filter_resource_fetches_; 00056 } 00057 Variable* num_flushes() { return num_flushes_; } 00058 Variable* resource_404_count() { return resource_404_count_; } 00059 Variable* resource_url_domain_rejections() { 00060 return resource_url_domain_rejections_; 00061 } 00062 Variable* slurp_404_count() { return slurp_404_count_; } 00063 Variable* succeeded_filter_resource_fetches() { 00064 return succeeded_filter_resource_fetches_; 00065 } 00066 Variable* total_page_load_ms() { return total_page_load_ms_; } 00069 Variable* page_load_count() { return page_load_count_; } 00070 Variable* fallback_responses_served() { 00071 return fallback_responses_served_; 00072 } 00073 Variable* num_conditional_refreshes() { return num_conditional_refreshes_; } 00074 00075 Variable* ipro_served() { return ipro_served_; } 00076 Variable* ipro_not_in_cache() { return ipro_not_in_cache_; } 00077 Variable* ipro_not_rewritable() { return ipro_not_rewritable_; } 00078 00079 Histogram* beacon_timings_ms_histogram() { 00080 return beacon_timings_ms_histogram_; 00081 } 00083 Histogram* fetch_latency_histogram() { return fetch_latency_histogram_; } 00085 Histogram* rewrite_latency_histogram() { return rewrite_latency_histogram_; } 00086 Histogram* backend_latency_histogram() { return backend_latency_histogram_; } 00087 00089 TimedVariable* total_fetch_count() { return total_fetch_count_; } 00091 TimedVariable* total_rewrite_count() { return total_rewrite_count_; } 00092 00093 Waveform* thread_queue_depth(RewriteDriverFactory::WorkerPoolCategory pool) { 00094 return thread_queue_depths_[pool]; 00095 } 00096 00097 TimedVariable* num_rewrites_executed() { return num_rewrites_executed_; } 00098 TimedVariable* num_rewrites_dropped() { return num_rewrites_dropped_; } 00099 00100 private: 00101 Variable* cached_output_hits_; 00102 Variable* cached_output_missed_deadline_; 00103 Variable* cached_output_misses_; 00104 Variable* cached_resource_fetches_; 00105 Variable* failed_filter_resource_fetches_; 00106 Variable* num_flushes_; 00107 Variable* page_load_count_; 00108 Variable* resource_404_count_; 00109 Variable* resource_url_domain_rejections_; 00110 Variable* slurp_404_count_; 00111 Variable* succeeded_filter_resource_fetches_; 00112 Variable* total_page_load_ms_; 00113 Variable* fallback_responses_served_; 00114 Variable* num_conditional_refreshes_; 00115 Variable* ipro_served_; 00116 Variable* ipro_not_in_cache_; 00117 Variable* ipro_not_rewritable_; 00118 00119 Histogram* beacon_timings_ms_histogram_; 00120 Histogram* fetch_latency_histogram_; 00121 Histogram* rewrite_latency_histogram_; 00122 Histogram* backend_latency_histogram_; 00123 00124 TimedVariable* total_fetch_count_; 00125 TimedVariable* total_rewrite_count_; 00126 TimedVariable* num_rewrites_executed_; 00127 TimedVariable* num_rewrites_dropped_; 00128 00129 std::vector<Waveform*> thread_queue_depths_; 00130 00131 DISALLOW_COPY_AND_ASSIGN(RewriteStats); 00132 }; 00133 00134 } 00135 00136 #endif ///< NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_STATS_H_