Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: webrtc/p2p/base/port.cc

Issue 1410533004: Round Rate computations from RateTracker. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Correct first-bucket rounding. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/ratetracker.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 SignalDestroyed(this); 1301 SignalDestroyed(this);
1302 delete this; 1302 delete this;
1303 } 1303 }
1304 1304
1305 uint32_t Connection::last_received() { 1305 uint32_t Connection::last_received() {
1306 return std::max(last_data_received_, 1306 return std::max(last_data_received_,
1307 std::max(last_ping_received_, last_ping_response_received_)); 1307 std::max(last_ping_received_, last_ping_response_received_));
1308 } 1308 }
1309 1309
1310 size_t Connection::recv_bytes_second() { 1310 size_t Connection::recv_bytes_second() {
1311 return recv_rate_tracker_.ComputeRate(); 1311 return round(recv_rate_tracker_.ComputeRate());
1312 } 1312 }
1313 1313
1314 size_t Connection::recv_total_bytes() { 1314 size_t Connection::recv_total_bytes() {
1315 return recv_rate_tracker_.TotalSampleCount(); 1315 return recv_rate_tracker_.TotalSampleCount();
1316 } 1316 }
1317 1317
1318 size_t Connection::sent_bytes_second() { 1318 size_t Connection::sent_bytes_second() {
1319 return send_rate_tracker_.ComputeRate(); 1319 return round(send_rate_tracker_.ComputeRate());
1320 } 1320 }
1321 1321
1322 size_t Connection::sent_total_bytes() { 1322 size_t Connection::sent_total_bytes() {
1323 return send_rate_tracker_.TotalSampleCount(); 1323 return send_rate_tracker_.TotalSampleCount();
1324 } 1324 }
1325 1325
1326 size_t Connection::sent_discarded_packets() { 1326 size_t Connection::sent_discarded_packets() {
1327 return sent_packets_discarded_; 1327 return sent_packets_discarded_;
1328 } 1328 }
1329 1329
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 ASSERT(sent < 0); 1414 ASSERT(sent < 0);
1415 error_ = port_->GetError(); 1415 error_ = port_->GetError();
1416 sent_packets_discarded_++; 1416 sent_packets_discarded_++;
1417 } else { 1417 } else {
1418 send_rate_tracker_.AddSamples(sent); 1418 send_rate_tracker_.AddSamples(sent);
1419 } 1419 }
1420 return sent; 1420 return sent;
1421 } 1421 }
1422 1422
1423 } // namespace cricket 1423 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/base/ratetracker.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698