diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 20:37:00 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 20:37:00 +0000 |
commit | b89f7e4d3f98fffe88bd07a57c735e28c37e692c (patch) | |
tree | fb0e304d16190673073e62a44a4ef0103ca48876 /net/socket/client_socket_pool_histograms.h | |
parent | b846407ff810e7cfb21642803bd00ed4d4883dc3 (diff) | |
download | chromium_src-b89f7e4d3f98fffe88bd07a57c735e28c37e692c.zip chromium_src-b89f7e4d3f98fffe88bd07a57c735e28c37e692c.tar.gz chromium_src-b89f7e4d3f98fffe88bd07a57c735e28c37e692c.tar.bz2 |
Make ClientSocketPool histograms static so that they work properly.
Also change their names so that they appear all together on the histograms
page.
BUG=43375
TEST=none
Review URL: http://codereview.chromium.org/2029004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool_histograms.h')
-rw-r--r-- | net/socket/client_socket_pool_histograms.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/net/socket/client_socket_pool_histograms.h b/net/socket/client_socket_pool_histograms.h new file mode 100644 index 0000000..1aea112 --- /dev/null +++ b/net/socket/client_socket_pool_histograms.h @@ -0,0 +1,37 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ +#define NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ + +#include <string> + +#include "base/histogram.h" +#include "base/ref_counted.h" + +namespace net { + +class ClientSocketPoolHistograms + : public base::RefCounted<ClientSocketPoolHistograms> { + public: + ClientSocketPoolHistograms(const std::string& pool_name); + + void AddSocketType(int socket_reuse_type) const; + void AddRequestTime(base::TimeDelta time) const; + void AddUnusedIdleTime(base::TimeDelta time) const; + void AddReusedIdleTime(base::TimeDelta time) const; + + private: + friend class base::RefCounted<ClientSocketPoolHistograms>; + ~ClientSocketPoolHistograms() {} + + scoped_refptr<Histogram> socket_type_; + scoped_refptr<Histogram> request_time_; + scoped_refptr<Histogram> unused_idle_time_; + scoped_refptr<Histogram> reused_idle_time_; +}; + +} // namespace net + +#endif // NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ |