Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
url_async_fetcher_stats.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
19 
20 #ifndef NET_INSTAWEB_HTTP_PUBLIC_URL_ASYNC_FETCHER_STATS_H_
21 #define NET_INSTAWEB_HTTP_PUBLIC_URL_ASYNC_FETCHER_STATS_H_
22 
27 
28 namespace net_instaweb {
29 
30 class AsyncFetch;
31 class Histogram;
32 class MessageHandler;
33 class Statistics;
34 class Timer;
35 class Variable;
36 
38  public:
49  UrlAsyncFetcherStats(StringPiece prefix,
50  UrlAsyncFetcher* base_fetcher,
51  Timer* timer,
52  Statistics* statistics);
53  virtual ~UrlAsyncFetcherStats();
54 
57  static void InitStats(StringPiece prefix, Statistics* statistics);
58 
61  virtual bool SupportsHttps() const;
62  virtual void Fetch(const GoogleString& url,
63  MessageHandler* message_handler,
64  AsyncFetch* fetch);
65  virtual int64 timeout_ms();
66  virtual void ShutDown();
67 
68  private:
69  class StatsAsyncFetch;
70 
71  UrlAsyncFetcher* base_fetcher_;
72  Timer* timer_;
73 
74  Histogram* fetch_latency_us_histogram_;
75  Variable* fetches_;
76  Variable* bytes_fetched_;
77  Variable* approx_header_bytes_fetched_;
78 
79 
80 };
81 
82 }
83 
84 #endif
Definition: url_async_fetcher_stats.h:37
Definition: statistics.h:43
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
virtual void Fetch(const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)
virtual bool SupportsHttps() const
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: async_fetch.h:53
UrlAsyncFetcherStats(StringPiece prefix, UrlAsyncFetcher *base_fetcher, Timer *timer, Statistics *statistics)
Definition: statistics.h:138
static void InitStats(StringPiece prefix, Statistics *statistics)
Definition: message_handler.h:39
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
Definition: url_async_fetcher.h:33