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 bytes received in this time frame. |
11 static const int kBandwidthWindow = 3; | 11 static const int kBandwidthWindow = 3; |
12 | 12 |
13 // Framerate is reported as number of frames received over the following | |
14 // time window. | |
Wez
2011/10/15 21:21:39
nit: Specify the units.
Jamie
2011/10/15 22:38:27
Or use a TimeDelta object. Not sure if that's allo
| |
15 static const int kFramerateWindow = 3; | |
16 | |
13 // We take the last 10 latency numbers and report the average. | 17 // We take the last 10 latency numbers and report the average. |
14 static const int kLatencyWindow = 10; | 18 static const int kLatencyWindow = 10; |
15 | 19 |
16 } // namespace | 20 } // namespace |
17 | 21 |
18 namespace remoting { | 22 namespace remoting { |
19 | 23 |
20 ChromotingStats::ChromotingStats() | 24 ChromotingStats::ChromotingStats() |
21 : video_bandwidth_(base::TimeDelta::FromSeconds(kBandwidthWindow)), | 25 : video_bandwidth_(base::TimeDelta::FromSeconds(kBandwidthWindow)), |
26 video_frame_rate_(base::TimeDelta::FromSeconds(kFramerateWindow)), | |
22 video_capture_ms_(kLatencyWindow), | 27 video_capture_ms_(kLatencyWindow), |
23 video_encode_ms_(kLatencyWindow), | 28 video_encode_ms_(kLatencyWindow), |
24 video_decode_ms_(kLatencyWindow), | 29 video_decode_ms_(kLatencyWindow), |
25 video_paint_ms_(kLatencyWindow), | 30 video_paint_ms_(kLatencyWindow), |
26 round_trip_ms_(kLatencyWindow) { | 31 round_trip_ms_(kLatencyWindow) { |
27 } | 32 } |
28 | 33 |
29 ChromotingStats::~ChromotingStats() { | 34 ChromotingStats::~ChromotingStats() { |
30 } | 35 } |
31 | 36 |
32 } // namespace remoting | 37 } // namespace remoting |
OLD | NEW |