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 base::TimeDelta kBandwidthWindow = |
12 base::TimeDelta::FromSeconds(3); | |
Wez
2011/10/21 18:01:43
I think these still need to be const int, and be c
| |
13 | |
14 // Framerate is reported as number of frames received over the following | |
15 // time window in seconds. | |
16 static const base::TimeDelta kFramerateWindow = | |
17 base::TimeDelta::FromSeconds(3); | |
Wez
2011/10/21 18:01:43
Why do we need separate frame-rate and bandwidth w
| |
12 | 18 |
13 // We take the last 10 latency numbers and report the average. | 19 // We take the last 10 latency numbers and report the average. |
14 static const int kLatencyWindow = 10; | 20 static const int kLatencyWindow = 10; |
15 | 21 |
16 } // namespace | 22 } // namespace |
17 | 23 |
18 namespace remoting { | 24 namespace remoting { |
19 | 25 |
20 ChromotingStats::ChromotingStats() | 26 ChromotingStats::ChromotingStats() |
21 : video_bandwidth_(base::TimeDelta::FromSeconds(kBandwidthWindow)), | 27 : video_bandwidth_(kBandwidthWindow), |
28 video_frame_rate_(kFramerateWindow), | |
22 video_capture_ms_(kLatencyWindow), | 29 video_capture_ms_(kLatencyWindow), |
23 video_encode_ms_(kLatencyWindow), | 30 video_encode_ms_(kLatencyWindow), |
24 video_decode_ms_(kLatencyWindow), | 31 video_decode_ms_(kLatencyWindow), |
25 video_paint_ms_(kLatencyWindow), | 32 video_paint_ms_(kLatencyWindow), |
26 round_trip_ms_(kLatencyWindow) { | 33 round_trip_ms_(kLatencyWindow) { |
27 } | 34 } |
28 | 35 |
29 ChromotingStats::~ChromotingStats() { | 36 ChromotingStats::~ChromotingStats() { |
30 } | 37 } |
31 | 38 |
32 } // namespace remoting | 39 } // namespace remoting |
OLD | NEW |