OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "remoting/client/chromoting_stats.h" | 5 #include "remoting/client/chromoting_stats.h" |
6 | 6 |
7 namespace { | 7 namespace { |
8 | 8 |
9 // The default window of bandwidth in seconds. Bandwidth is reported as | 9 // The default window of bandwidth in seconds. Bandwidth is reported as |
10 // number of numbers received in this time frame. | 10 // number of numbers received in this time frame. |
11 static const int kBandwidthWindow = 3; | 11 static const int kBandwidthWindow = 3; |
12 | 12 |
13 // We take the last 10 latency numbers and report the average. | 13 // We take the last 10 latency numbers and report the average. |
14 static const int kLatencyWindow = 10; | 14 static const int kLatencyWindow = 10; |
15 | 15 |
16 } // namespace | 16 } // namespace |
17 | 17 |
18 namespace remoting { | 18 namespace remoting { |
19 | 19 |
20 ChromotingStats::ChromotingStats() | 20 ChromotingStats::ChromotingStats() |
21 : video_bandwidth_(base::TimeDelta::FromSeconds(kBandwidthWindow)), | 21 : video_bandwidth_(base::TimeDelta::FromSeconds(kBandwidthWindow)), |
22 video_capture_ms_(kLatencyWindow), | 22 video_capture_ms_(kLatencyWindow), |
23 video_encode_ms_(kLatencyWindow), | 23 video_encode_ms_(kLatencyWindow), |
24 video_decode_ms_(kLatencyWindow), | 24 video_decode_ms_(kLatencyWindow), |
25 video_paint_ms_(kLatencyWindow) { | 25 video_paint_ms_(kLatencyWindow), |
| 26 round_trip_ms_(kLatencyWindow) { |
26 } | 27 } |
27 | 28 |
28 ChromotingStats::~ChromotingStats() { | 29 ChromotingStats::~ChromotingStats() { |
29 } | 30 } |
30 | 31 |
31 } // namespace remoting | 32 } // namespace remoting |
OLD | NEW |