| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/quic/congestion_control/inter_arrival_overuse_detector.h" | 5 #include "net/quic/congestion_control/inter_arrival_overuse_detector.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (delta_overuse_counter_ > 0 && | 156 if (delta_overuse_counter_ > 0 && |
| 157 accumulated_deltas_.ToMicroseconds() > kThresholdAccumulatedDeltasUs) { | 157 accumulated_deltas_.ToMicroseconds() > kThresholdAccumulatedDeltasUs) { |
| 158 if (delta_estimate_ != kBandwidthDraining) { | 158 if (delta_estimate_ != kBandwidthDraining) { |
| 159 DVLOG(1) << "Bandwidth estimate drift: Draining buffer(s) " | 159 DVLOG(1) << "Bandwidth estimate drift: Draining buffer(s) " |
| 160 << accumulated_deltas_.ToMilliseconds() << " ms"; | 160 << accumulated_deltas_.ToMilliseconds() << " ms"; |
| 161 delta_estimate_ = kBandwidthDraining; | 161 delta_estimate_ = kBandwidthDraining; |
| 162 } | 162 } |
| 163 return; | 163 return; |
| 164 } | 164 } |
| 165 if ((sigma_delta * kDetectTimeDiffStandardDeviation > | 165 if ((sigma_delta * kDetectTimeDiffStandardDeviation > |
| 166 estimated_congestion_delay_.ToMicroseconds()) && | 166 estimated_congestion_delay_.ToMicroseconds()) && |
| 167 (sigma_delta * kDetectDriftStandardDeviation > | 167 (sigma_delta * kDetectDriftStandardDeviation > |
| 168 abs(accumulated_deltas_.ToMicroseconds()))) { | 168 std::abs(accumulated_deltas_.ToMicroseconds()))) { |
| 169 if (delta_estimate_ != kBandwidthSteady) { | 169 if (delta_estimate_ != kBandwidthSteady) { |
| 170 DVLOG(1) << "Bandwidth estimate drift: Steady" | 170 DVLOG(1) << "Bandwidth estimate drift: Steady" |
| 171 << " mean:" << delta_mean_ | 171 << " mean:" << delta_mean_ |
| 172 << " sigma:" << sigma_delta | 172 << " sigma:" << sigma_delta |
| 173 << " offset:" << send_receive_offset_.ToMicroseconds() | 173 << " offset:" << send_receive_offset_.ToMicroseconds() |
| 174 << " delta:" << estimated_congestion_delay_.ToMicroseconds() | 174 << " delta:" << estimated_congestion_delay_.ToMicroseconds() |
| 175 << " drift:" << accumulated_deltas_.ToMicroseconds(); | 175 << " drift:" << accumulated_deltas_.ToMicroseconds(); |
| 176 delta_estimate_ = kBandwidthSteady; | 176 delta_estimate_ = kBandwidthSteady; |
| 177 // Reset drift counter. | 177 // Reset drift counter. |
| 178 accumulated_deltas_ = QuicTime::Delta::Zero(); | 178 accumulated_deltas_ = QuicTime::Delta::Zero(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 --slope_overuse_counter_; | 247 --slope_overuse_counter_; |
| 248 DVLOG(1) << "Bandwidth estimate slope: Under using" | 248 DVLOG(1) << "Bandwidth estimate slope: Under using" |
| 249 << " mean:" << delta_mean_ | 249 << " mean:" << delta_mean_ |
| 250 << " sigma:" << sigma_delta; | 250 << " sigma:" << sigma_delta; |
| 251 slope_estimate_ = kBandwidthUnderUsing; | 251 slope_estimate_ = kBandwidthUnderUsing; |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace net | 256 } // namespace net |
| OLD | NEW |