OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 throughput_bytes_(), | 123 throughput_bytes_(), |
124 weighted_estimate_error_(), | 124 weighted_estimate_error_(), |
125 last_unweighted_estimate_error_(0), | 125 last_unweighted_estimate_error_(0), |
126 optimal_throughput_bits_(0), | 126 optimal_throughput_bits_(0), |
127 last_available_bitrate_per_flow_kbps_(0), | 127 last_available_bitrate_per_flow_kbps_(0), |
128 start_computing_metrics_ms_(0), | 128 start_computing_metrics_ms_(0), |
129 started_computing_metrics_(false) { | 129 started_computing_metrics_(false) { |
130 } | 130 } |
131 | 131 |
132 void MetricRecorder::SetPlotInformation( | 132 void MetricRecorder::SetPlotInformation( |
133 const std::vector<std::string>& prefixes) { | 133 const std::vector<std::string>& prefixes, |
| 134 bool plot_delay, |
| 135 bool plot_loss) { |
134 assert(prefixes.size() == kNumMetrics); | 136 assert(prefixes.size() == kNumMetrics); |
135 for (size_t i = 0; i < kNumMetrics; ++i) { | 137 for (size_t i = 0; i < kNumMetrics; ++i) { |
136 plot_information_[i].prefix = prefixes[i]; | 138 plot_information_[i].prefix = prefixes[i]; |
137 } | 139 } |
138 plot_information_[kThroughput].plot_interval_ms = 100; | 140 plot_information_[kThroughput].plot_interval_ms = 100; |
139 plot_information_[kDelay].plot_interval_ms = 100; | 141 plot_information_[kDelay].plot_interval_ms = 100; |
140 plot_information_[kLoss].plot_interval_ms = 500; | 142 plot_information_[kLoss].plot_interval_ms = 500; |
141 plot_information_[kObjective].plot_interval_ms = 1000; | 143 plot_information_[kObjective].plot_interval_ms = 1000; |
142 plot_information_[kTotalAvailable].plot_interval_ms = 1000; | 144 plot_information_[kTotalAvailable].plot_interval_ms = 1000; |
143 plot_information_[kAvailablePerFlow].plot_interval_ms = 1000; | 145 plot_information_[kAvailablePerFlow].plot_interval_ms = 1000; |
144 | 146 |
145 for (int i = kThroughput; i < kNumMetrics; ++i) { | 147 for (int i = kThroughput; i < kNumMetrics; ++i) { |
146 plot_information_[i].last_plot_ms = 0; | 148 plot_information_[i].last_plot_ms = 0; |
147 if (i == kObjective || i == kAvailablePerFlow) { | 149 switch (i) { |
148 plot_information_[i].plot = false; | 150 case kAvailablePerFlow: |
149 } else { | 151 case kObjective: |
150 plot_information_[i].plot = true; | 152 plot_information_[i].plot = false; |
| 153 break; |
| 154 case kLoss: |
| 155 plot_information_[i].plot = plot_loss; |
| 156 break; |
| 157 case kDelay: |
| 158 plot_information_[i].plot = plot_delay; |
| 159 break; |
| 160 default: |
| 161 plot_information_[i].plot = true; |
151 } | 162 } |
152 } | 163 } |
153 } | 164 } |
154 | 165 |
155 void MetricRecorder::PlotAllDynamics() { | 166 void MetricRecorder::PlotAllDynamics() { |
156 for (int i = kThroughput; i < kNumMetrics; ++i) { | 167 for (int i = kThroughput; i < kNumMetrics; ++i) { |
157 if (plot_information_[i].plot && | 168 if (plot_information_[i].plot && |
158 now_ms_ - plot_information_[i].last_plot_ms >= | 169 now_ms_ - plot_information_[i].last_plot_ms >= |
159 plot_information_[i].plot_interval_ms) { | 170 plot_information_[i].plot_interval_ms) { |
160 PlotDynamics(i); | 171 PlotDynamics(i); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 440 |
430 void MetricRecorder::ResumeFlow(int64_t paused_time_ms) { | 441 void MetricRecorder::ResumeFlow(int64_t paused_time_ms) { |
431 UpdateTime(now_ms_ + paused_time_ms); | 442 UpdateTime(now_ms_ + paused_time_ms); |
432 PlotZero(); | 443 PlotZero(); |
433 link_share_->ResumeFlow(flow_id_); | 444 link_share_->ResumeFlow(flow_id_); |
434 } | 445 } |
435 | 446 |
436 } // namespace bwe | 447 } // namespace bwe |
437 } // namespace testing | 448 } // namespace testing |
438 } // namespace webrtc | 449 } // namespace webrtc |
OLD | NEW |