| // Copyright (c) 2011 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. |
| // Collect metrics of SocketStream usage. |
| // TODO(ukai): collect WebSocket specific metrics (e.g. handshake time, etc). |
| #ifndef NET_SOCKET_STREAM_SOCKET_STREAM_METRICS_H_ |
| #define NET_SOCKET_STREAM_SOCKET_STREAM_METRICS_H_ |
| #include "base/basictypes.h" |
| #include "net/base/net_export.h" |
| class NET_EXPORT_PRIVATE SocketStreamMetrics { |
| PROTOCOL_WEBSOCKET_SECURE, |
| explicit SocketStreamMetrics(const GURL& url); |
| void OnStartConnection(); |
| void OnCountConnectionType(ConnectionType type); |
| void OnCountWireProtocolType(WireProtocolType type); |
| base::TimeTicks wait_start_time_; |
| base::TimeTicks connect_start_time_; |
| base::TimeTicks connect_establish_time_; |
| DISALLOW_COPY_AND_ASSIGN(SocketStreamMetrics); |
| #endif // NET_SOCKET_STREAM_SOCKET_STREAM_METRICS_H_ |