OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2957 check_ping_status_pending_ = false; | 2957 check_ping_status_pending_ = false; |
2958 return; | 2958 return; |
2959 } | 2959 } |
2960 | 2960 |
2961 DCHECK(check_ping_status_pending_); | 2961 DCHECK(check_ping_status_pending_); |
2962 | 2962 |
2963 base::TimeTicks now = time_func_(); | 2963 base::TimeTicks now = time_func_(); |
2964 base::TimeDelta delay = hung_interval_ - (now - last_activity_time_); | 2964 base::TimeDelta delay = hung_interval_ - (now - last_activity_time_); |
2965 | 2965 |
2966 if (delay.InMilliseconds() < 0 || last_activity_time_ < last_check_time) { | 2966 if (delay.InMilliseconds() < 0 || last_activity_time_ < last_check_time) { |
2967 // Track all failed PING messages in a separate bucket. | |
2968 RecordPingRTTHistogram(base::TimeDelta::Max()); | |
2969 DoDrainSession(ERR_SPDY_PING_FAILED, "Failed ping."); | 2967 DoDrainSession(ERR_SPDY_PING_FAILED, "Failed ping."); |
2970 return; | 2968 return; |
2971 } | 2969 } |
2972 | 2970 |
2973 // Check the status of connection after a delay. | 2971 // Check the status of connection after a delay. |
2974 base::MessageLoop::current()->PostDelayedTask( | 2972 base::MessageLoop::current()->PostDelayedTask( |
2975 FROM_HERE, | 2973 FROM_HERE, |
2976 base::Bind(&SpdySession::CheckPingStatus, weak_factory_.GetWeakPtr(), | 2974 base::Bind(&SpdySession::CheckPingStatus, weak_factory_.GetWeakPtr(), |
2977 now), | 2975 now), |
2978 delay); | 2976 delay); |
2979 } | 2977 } |
2980 | 2978 |
2981 void SpdySession::RecordPingRTTHistogram(base::TimeDelta duration) { | 2979 void SpdySession::RecordPingRTTHistogram(base::TimeDelta duration) { |
2982 UMA_HISTOGRAM_TIMES("Net.SpdyPing.RTT", duration); | 2980 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyPing.RTT", duration, |
| 2981 base::TimeDelta::FromMilliseconds(1), |
| 2982 base::TimeDelta::FromMinutes(10), 100); |
2983 } | 2983 } |
2984 | 2984 |
2985 void SpdySession::RecordProtocolErrorHistogram( | 2985 void SpdySession::RecordProtocolErrorHistogram( |
2986 SpdyProtocolErrorDetails details) { | 2986 SpdyProtocolErrorDetails details) { |
2987 UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionErrorDetails2", details, | 2987 UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionErrorDetails2", details, |
2988 NUM_SPDY_PROTOCOL_ERROR_DETAILS); | 2988 NUM_SPDY_PROTOCOL_ERROR_DETAILS); |
2989 if (EndsWith(host_port_pair().host(), "google.com", false)) { | 2989 if (EndsWith(host_port_pair().host(), "google.com", false)) { |
2990 UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionErrorDetails_Google2", details, | 2990 UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionErrorDetails_Google2", details, |
2991 NUM_SPDY_PROTOCOL_ERROR_DETAILS); | 2991 NUM_SPDY_PROTOCOL_ERROR_DETAILS); |
2992 } | 2992 } |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3267 if (!queue->empty()) { | 3267 if (!queue->empty()) { |
3268 SpdyStreamId stream_id = queue->front(); | 3268 SpdyStreamId stream_id = queue->front(); |
3269 queue->pop_front(); | 3269 queue->pop_front(); |
3270 return stream_id; | 3270 return stream_id; |
3271 } | 3271 } |
3272 } | 3272 } |
3273 return 0; | 3273 return 0; |
3274 } | 3274 } |
3275 | 3275 |
3276 } // namespace net | 3276 } // namespace net |
OLD | NEW |