Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py

Issue 2512693002: Implement Theil-Sen's method for fitting a line to noisy data (used in bandwidth estimation). (Closed)
Patch Set: Remove PercentileFilter::Clear since no longer used. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/congestion_controller/median_slope_estimator_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 detector_state = Figure("DetectorState") 139 detector_state = Figure("DetectorState")
140 detector_state.addSubplot(['offset_ms'], "Time (s)", "Offset") 140 detector_state.addSubplot(['offset_ms'], "Time (s)", "Offset")
141 detector_state.addSubplot(['gamma_ms'], "Time (s)", "Gamma") 141 detector_state.addSubplot(['gamma_ms'], "Time (s)", "Gamma")
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")
149 target_bitrate.addSubplot(['target_bitrate_bps'], "Time (s)", "Bitrate (bps)")
150
148 # Select which figures to plot here. 151 # Select which figures to plot here.
149 figures = [receiver, detector_state, trendline_state] 152 figures = [receiver, detector_state, trendline_state, target_bitrate]
150 153
151 # Add samples to the figures. 154 # Add samples to the figures.
152 for line in sys.stdin: 155 for line in sys.stdin:
153 if line.startswith("[ RUN ]"): 156 if line.startswith("[ RUN ]"):
154 test_name = re.search(r'\.(\w+)', line).group(1) 157 test_name = re.search(r'\.(\w+)', line).group(1)
155 if line.startswith("PLOT"): 158 if line.startswith("PLOT"):
156 try: 159 try:
157 (var_name, ssrc, alg_name, time, value) = parse_plot_line(line) 160 (var_name, ssrc, alg_name, time, value) = parse_plot_line(line)
158 for f in figures: 161 for f in figures:
159 # 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.
160 f.addSample(var_name, ssrc, alg_name, time, value) 163 f.addSample(var_name, ssrc, alg_name, time, value)
161 except ParsePlotLineException as e: 164 except ParsePlotLineException as e:
162 print e.reason 165 print e.reason
163 print e.line 166 print e.line
164 167
165 # Plot figures. 168 # Plot figures.
166 for f in figures: 169 for f in figures:
167 fig = plt.figure(f.name) 170 fig = plt.figure(f.name)
168 f.plotFigure(fig) 171 f.plotFigure(fig)
169 if save_figure: 172 if save_figure:
170 fig.savefig(test_name + f.name + ".png") 173 fig.savefig(test_name + f.name + ".png")
171 plt.show() 174 plt.show()
172 175
173 if __name__ == '__main__': 176 if __name__ == '__main__':
174 main() 177 main()
OLDNEW
« no previous file with comments | « webrtc/modules/congestion_controller/median_slope_estimator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698