Chromium Code Reviews| Index: webrtc/modules/remote_bitrate_estimator/test/packet_receiver.cc |
| diff --git a/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.cc b/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.cc |
| index acae76e797de8b60eebca78ee89b2dbbdfaa9835..2ac6bd893f6afd6ae58be5d6649934758c56de08 100644 |
| --- a/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.cc |
| +++ b/webrtc/modules/remote_bitrate_estimator/test/packet_receiver.cc |
| @@ -32,32 +32,22 @@ PacketReceiver::PacketReceiver(PacketProcessorListener* listener, |
| MetricRecorder* metric_recorder) |
| : PacketProcessor(listener, flow_id, kReceiver), |
| bwe_receiver_(CreateBweReceiver(bwe_type, flow_id, plot_bwe)), |
| - metric_recorder_(metric_recorder) { |
| + metric_recorder_(metric_recorder), |
| + plot_delay_(plot_delay), |
| + last_delay_plot_ms_(0), |
| + delay_prefix_("Delay_ms#d") { |
|
stefan-webrtc
2015/07/24 09:30:43
What is #d?
magalhaesc
2015/07/24 13:51:40
Replaced with #2, alignment with the right axis.
|
| if (metric_recorder_ != nullptr) { |
| // Setup the prefix ststd::rings used when logging. |
| std::vector<std::string> prefixes; |
| - std::stringstream ss1; |
| - ss1 << "Throughput_kbps_" << flow_id << "#2"; |
| - prefixes.push_back(ss1.str()); // Throughput. |
| - |
| - std::stringstream ss2; |
| - ss2 << "Delay_ms_" << flow_id << "#2"; |
| - prefixes.push_back(ss2.str()); // Delay. |
| - |
| - std::stringstream ss3; |
| - ss3 << "Packet_Loss_" << flow_id << "#2"; |
| - prefixes.push_back(ss3.str()); // Loss. |
| - |
| - std::stringstream ss4; |
| - ss4 << "Objective_function_" << flow_id << "#2"; |
| - prefixes.push_back(ss4.str()); // Objective. |
| + prefixes.push_back("Throughput_kbps#2"); // Throughput. |
|
stefan-webrtc
2015/07/24 09:30:42
I find it odd that this is on #2 and not #1. Could
magalhaesc
2015/07/24 13:51:40
Done, Adopting #1 for left axis alignment.
The fl
stefan-webrtc
2015/07/24 14:06:55
Sounds good
|
| + prefixes.push_back("Delay_ms_#2"); // Delay. |
|
stefan-webrtc
2015/07/24 09:30:42
Should Delay_ms_#2 be the same format as Delay_ms#
magalhaesc
2015/07/24 13:51:40
The metric recorder uses separate figure_id for ea
stefan-webrtc
2015/07/24 14:06:55
Sounds good.
|
| + prefixes.push_back("Packet_Loss_#2"); // Loss. |
| + prefixes.push_back("Objective_function_#2"); // Objective. |
| // Plot Total/PerFlow Available capacity together with throughputs. |
| - std::stringstream ss5; |
| - ss5 << "Throughput_kbps" << flow_id << "#1"; |
| - prefixes.push_back(ss5.str()); // Total Available. |
| - prefixes.push_back(ss5.str()); // Available per flow. |
| + prefixes.push_back("Throughput_kbps#1"); // Total Available. |
| + prefixes.push_back("Throughput_kbps#1"); // Available per flow. |
| metric_recorder_->SetPlotInformation(prefixes); |
| } |
| @@ -102,6 +92,8 @@ void PacketReceiver::RunFor(int64_t time_ms, Packets* in_out) { |
| UpdateMetrics(arrival_time_ms, send_time_ms, |
| media_packet->payload_size()); |
| metric_recorder_->PlotAllDynamics(); |
| + } else if (plot_delay_) { |
| + PlotDelay(arrival_time_ms, send_time_ms); |
| } |
| bwe_receiver_->ReceivePacket(arrival_time_ms, *media_packet); |
| @@ -127,6 +119,15 @@ void PacketReceiver::UpdateMetrics(int64_t arrival_time_ms, |
| metric_recorder_->UpdateObjective(); |
| } |
| +void PacketReceiver::PlotDelay(int64_t arrival_time_ms, int64_t send_time_ms) { |
| + const int64_t kDelayPlotIntervalMs = 100; |
| + if (arrival_time_ms >= last_delay_plot_ms_ + kDelayPlotIntervalMs) { |
| + BWE_TEST_LOGGING_PLOT(0, delay_prefix_, arrival_time_ms, |
| + arrival_time_ms - send_time_ms); |
| + last_delay_plot_ms_ = arrival_time_ms; |
| + } |
| +} |
| + |
| float PacketReceiver::GlobalPacketLoss() { |
| return bwe_receiver_->GlobalReceiverPacketLossRatio(); |
| } |