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

Side by Side Diff: webrtc/tools/py_event_log_analyzer/rtp_analyzer.py

Issue 2316573003: Python event log analyzer tool: fix of indexing issue. (Closed)
Patch Set: Presubmit complaint. Created 4 years, 3 months 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
OLDNEW
1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license 3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source 4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found 5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS. All contributing project authors may 6 # in the file PATENTS. All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree. 7 # be found in the AUTHORS file in the root of the source tree.
8 8
9 """Displays statistics and plots graphs from RTC protobuf dump.""" 9 """Displays statistics and plots graphs from RTC protobuf dump."""
10 10
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 def calculate_delay(start, stop, step, points): 274 def calculate_delay(start, stop, step, points):
275 """Quantizes the time coordinates for the delay. 275 """Quantizes the time coordinates for the delay.
276 276
277 Quantizes points by rounding the timestamps downwards to the nearest 277 Quantizes points by rounding the timestamps downwards to the nearest
278 point in the time sequence start, start+step, start+2*step... Takes 278 point in the time sequence start, start+step, start+2*step... Takes
279 the average of the delays of points rounded to the same. Returns 279 the average of the delays of points rounded to the same. Returns
280 masked array, in which time points with no value are masked. 280 masked array, in which time points with no value are masked.
281 281
282 """ 282 """
283 grouped_delays = [[] for _ in numpy.arange(start, stop, step)] 283 grouped_delays = [[] for _ in numpy.arange(start, stop + step, step)]
284 rounded_value_index = lambda x: int((x - start) / step) 284 rounded_value_index = lambda x: int((x - start) / step)
285 for point in points: 285 for point in points:
286 grouped_delays[rounded_value_index(point.real_send_time_ms) 286 grouped_delays[rounded_value_index(point.real_send_time_ms)
287 ].append(point.absdelay) 287 ].append(point.absdelay)
288 regularized_delays = [numpy.average(arr) if arr else -1 for arr in 288 regularized_delays = [numpy.average(arr) if arr else -1 for arr in
289 grouped_delays] 289 grouped_delays]
290 return numpy.ma.masked_values(regularized_delays, -1) 290 return numpy.ma.masked_values(regularized_delays, -1)
291 291
292 292
293 def main(): 293 def main():
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 print("Statistics:") 331 print("Statistics:")
332 rtp_stats.print_sequence_number_statistics() 332 rtp_stats.print_sequence_number_statistics()
333 rtp_stats.estimate_frequency(options.query_sample_rate) 333 rtp_stats.estimate_frequency(options.query_sample_rate)
334 rtp_stats.print_duration_statistics() 334 rtp_stats.print_duration_statistics()
335 rtp_stats.remove_reordered() 335 rtp_stats.remove_reordered()
336 rtp_stats.compute_bandwidth() 336 rtp_stats.compute_bandwidth()
337 rtp_stats.plot_statistics() 337 rtp_stats.plot_statistics()
338 338
339 if __name__ == "__main__": 339 if __name__ == "__main__":
340 main() 340 main()
OLDNEW
« no previous file with comments | « webrtc/tools/py_event_log_analyzer/misc_test.py ('k') | webrtc/tools/py_event_log_analyzer/rtp_analyzer_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698