OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
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 # This script is used to plot simulation dynamics. The expected format is | 10 # This script is used to plot simulation dynamics. The expected format is |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 | 142 |
143 trendline_state = Figure("TrendlineState") | 143 trendline_state = Figure("TrendlineState") |
144 trendline_state.AddSubplot(["accumulated_delay_ms", "smoothed_delay_ms"], | 144 trendline_state.AddSubplot(["accumulated_delay_ms", "smoothed_delay_ms"], |
145 "Time (s)", "Delay (ms)") | 145 "Time (s)", "Delay (ms)") |
146 trendline_state.AddSubplot(["trendline_slope"], "Time (s)", "Slope") | 146 trendline_state.AddSubplot(["trendline_slope"], "Time (s)", "Slope") |
147 | 147 |
148 target_bitrate = Figure("TargetBitrate") | 148 target_bitrate = Figure("TargetBitrate") |
149 target_bitrate.AddSubplot(['target_bitrate_bps'], "Time (s)", "Bitrate (bps)") | 149 target_bitrate.AddSubplot(['target_bitrate_bps'], "Time (s)", "Bitrate (bps)") |
150 | 150 |
151 # Select which figures to plot here. | 151 # Select which figures to plot here. |
152 figures = [receiver, detector_state, trendline_state, target_bitrate] | 152 figures = [receiver] |
philipel
2017/05/29 09:38:50
Undo this change
gnish2
2017/05/29 11:04:26
Done.
| |
153 | 153 |
154 # Add samples to the figures. | 154 # Add samples to the figures. |
155 for line in sys.stdin: | 155 for line in sys.stdin: |
156 if line.startswith("[ RUN ]"): | 156 if line.startswith("[ RUN ]"): |
157 test_name = re.search(r'\.(\w+)', line).group(1) | 157 test_name = re.search(r'\.(\w+)', line).group(1) |
158 if line.startswith("PLOT"): | 158 if line.startswith("PLOT"): |
159 try: | 159 try: |
160 (var_name, ssrc, alg_name, time, value) = ParsePlotLine(line) | 160 (var_name, ssrc, alg_name, time, value) = ParsePlotLine(line) |
161 for f in figures: | 161 for f in figures: |
162 # The sample will be ignored bv the figures that don't need it. | 162 # The sample will be ignored bv the figures that don't need it. |
163 f.AddSample(var_name, ssrc, alg_name, time, value) | 163 f.AddSample(var_name, ssrc, alg_name, time, value) |
164 except ParsePlotLineException as e: | 164 except ParsePlotLineException as e: |
165 print e.reason | 165 print e.reason |
166 print e.line | 166 print e.line |
167 | 167 |
168 # Plot figures. | 168 # Plot figures. |
169 for f in figures: | 169 for f in figures: |
170 fig = plt.figure(f.name) | 170 fig = plt.figure(f.name) |
171 f.PlotFigure(fig) | 171 f.PlotFigure(fig) |
172 if SAVE_FIGURE: | 172 if SAVE_FIGURE: |
173 fig.savefig(test_name + f.name + ".png") | 173 fig.savefig(test_name + f.name + ".png") |
174 plt.show() | 174 plt.show() |
175 | 175 |
176 if __name__ == '__main__': | 176 if __name__ == '__main__': |
177 main() | 177 main() |
OLD | NEW |