OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 ss << name << "_" << flow_id; | 261 ss << name << "_" << flow_id; |
262 name_ = ss.str(); | 262 name_ = ss.str(); |
263 } | 263 } |
264 | 264 |
265 RateCounterFilter::RateCounterFilter(PacketProcessorListener* listener, | 265 RateCounterFilter::RateCounterFilter(PacketProcessorListener* listener, |
266 const FlowIds& flow_ids, | 266 const FlowIds& flow_ids, |
267 const char* name) | 267 const char* name) |
268 : PacketProcessor(listener, flow_ids, kRegular), | 268 : PacketProcessor(listener, flow_ids, kRegular), |
269 packets_per_second_stats_(), | 269 packets_per_second_stats_(), |
270 kbps_stats_(), | 270 kbps_stats_(), |
271 name_(), | 271 name_(std::string(name) + "_A"), // All flow ids. |
stefan-webrtc
2015/07/24 09:30:42
I don't fully understand this. What if a RateCount
magalhaesc
2015/07/24 11:46:40
Right, I didn't consider that.
Replaced back with
| |
272 start_plotting_time_ms_(0) { | 272 start_plotting_time_ms_(0) { |
273 std::stringstream ss; | |
274 ss << name << "_"; | |
275 for (int flow_id : flow_ids) { | |
276 ss << flow_id << ","; | |
277 } | |
278 name_ = ss.str(); | |
279 } | 273 } |
280 | 274 |
281 RateCounterFilter::RateCounterFilter(PacketProcessorListener* listener, | 275 RateCounterFilter::RateCounterFilter(PacketProcessorListener* listener, |
282 const FlowIds& flow_ids, | 276 const FlowIds& flow_ids, |
283 const char* name, | 277 const char* name, |
284 int64_t start_plotting_time_ms) | 278 int64_t start_plotting_time_ms) |
285 : RateCounterFilter(listener, flow_ids, name) { | 279 : RateCounterFilter(listener, flow_ids, name) { |
286 start_plotting_time_ms_ = start_plotting_time_ms; | 280 start_plotting_time_ms_ = start_plotting_time_ms; |
287 } | 281 } |
288 | 282 |
(...skipping 11 matching lines...) Expand all Loading... | |
300 Stats<double> RateCounterFilter::GetBitrateStats() const { | 294 Stats<double> RateCounterFilter::GetBitrateStats() const { |
301 return kbps_stats_; | 295 return kbps_stats_; |
302 } | 296 } |
303 | 297 |
304 void RateCounterFilter::Plot(int64_t timestamp_ms) { | 298 void RateCounterFilter::Plot(int64_t timestamp_ms) { |
305 uint32_t plot_kbps = 0; | 299 uint32_t plot_kbps = 0; |
306 if (timestamp_ms >= start_plotting_time_ms_) { | 300 if (timestamp_ms >= start_plotting_time_ms_) { |
307 plot_kbps = rate_counter_.bits_per_second() / 1000.0; | 301 plot_kbps = rate_counter_.bits_per_second() / 1000.0; |
308 } | 302 } |
309 BWE_TEST_LOGGING_CONTEXT(name_.c_str()); | 303 BWE_TEST_LOGGING_CONTEXT(name_.c_str()); |
310 BWE_TEST_LOGGING_PLOT(0, "Throughput_#1", timestamp_ms, plot_kbps); | 304 BWE_TEST_LOGGING_PLOT(0, "Throughput_kbps#2", timestamp_ms, plot_kbps); |
stefan-webrtc
2015/07/24 09:30:42
Isn't #1 the bitrate axis and #2 the delay axis?
magalhaesc
2015/07/24 13:51:40
Yes.
I was using d for delay, will go back to the
| |
311 RTC_UNUSED(plot_kbps); | 305 RTC_UNUSED(plot_kbps); |
312 } | 306 } |
313 | 307 |
314 void RateCounterFilter::RunFor(int64_t /*time_ms*/, Packets* in_out) { | 308 void RateCounterFilter::RunFor(int64_t /*time_ms*/, Packets* in_out) { |
315 assert(in_out); | 309 assert(in_out); |
316 for (const Packet* packet : *in_out) { | 310 for (const Packet* packet : *in_out) { |
317 rate_counter_.UpdateRates(packet->send_time_us(), | 311 rate_counter_.UpdateRates(packet->send_time_us(), |
318 static_cast<int>(packet->payload_size())); | 312 static_cast<int>(packet->payload_size())); |
319 } | 313 } |
320 packets_per_second_stats_.Push(rate_counter_.packets_per_second()); | 314 packets_per_second_stats_.Push(rate_counter_.packets_per_second()); |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
831 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, | 825 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, |
832 uint32_t remaining_payload) { | 826 uint32_t remaining_payload) { |
833 uint32_t fragments = | 827 uint32_t fragments = |
834 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; | 828 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; |
835 uint32_t avg_size = (frame_size + fragments - 1) / fragments; | 829 uint32_t avg_size = (frame_size + fragments - 1) / fragments; |
836 return std::min(avg_size, remaining_payload); | 830 return std::min(avg_size, remaining_payload); |
837 } | 831 } |
838 } // namespace bwe | 832 } // namespace bwe |
839 } // namespace testing | 833 } // namespace testing |
840 } // namespace webrtc | 834 } // namespace webrtc |
OLD | NEW |