| OLD | NEW |
| 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 30 matching lines...) Expand all Loading... |
| 41 """ | 41 """ |
| 42 | 42 |
| 43 self.data_points = data_points | 43 self.data_points = data_points |
| 44 self.ssrc_frequencies = misc.normalize_counter( | 44 self.ssrc_frequencies = misc.normalize_counter( |
| 45 collections.Counter([pt.ssrc for pt in self.data_points])) | 45 collections.Counter([pt.ssrc for pt in self.data_points])) |
| 46 self.ssrc_size_table = misc.ssrc_normalized_size_table(self.data_points) | 46 self.ssrc_size_table = misc.ssrc_normalized_size_table(self.data_points) |
| 47 self.bandwidth_kbps = None | 47 self.bandwidth_kbps = None |
| 48 self.smooth_bw_kbps = None | 48 self.smooth_bw_kbps = None |
| 49 | 49 |
| 50 def print_header_statistics(self): | 50 def print_header_statistics(self): |
| 51 print("{:>6}{:>11}{:>11}{:>6}{:>6}{:>3}{:>11}".format( | 51 print("{:>6}{:>14}{:>14}{:>6}{:>6}{:>3}{:>11}".format( |
| 52 "SeqNo", "TimeStamp", "SendTime", "Size", "PT", "M", "SSRC")) | 52 "SeqNo", "TimeStamp", "SendTime", "Size", "PT", "M", "SSRC")) |
| 53 for point in self.data_points: | 53 for point in self.data_points: |
| 54 print("{:>6}{:>11}{:>11}{:>6}{:>6}{:>3}{:>11}".format( | 54 print("{:>6}{:>14}{:>14}{:>6}{:>6}{:>3}{:>11}".format( |
| 55 point.sequence_number, point.timestamp, | 55 point.sequence_number, point.timestamp, |
| 56 int(point.arrival_timestamp_ms), point.size, point.payload_type, | 56 int(point.arrival_timestamp_ms), point.size, point.payload_type, |
| 57 point.marker_bit, "0x{:x}".format(point.ssrc))) | 57 point.marker_bit, "0x{:x}".format(point.ssrc))) |
| 58 | 58 |
| 59 def print_ssrc_info(self, ssrc_id, ssrc): | 59 def print_ssrc_info(self, ssrc_id, ssrc): |
| 60 """Prints packet and size statistics for a given SSRC. | 60 """Prints packet and size statistics for a given SSRC. |
| 61 | 61 |
| 62 Args: | 62 Args: |
| 63 ssrc_id: textual identifier of SSRC printed beside statistics for it. | 63 ssrc_id: textual identifier of SSRC printed beside statistics for it. |
| 64 ssrc: SSRC by which to filter data and display statistics | 64 ssrc: SSRC by which to filter data and display statistics |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 print("Statistics:") | 312 print("Statistics:") |
| 313 rtp_stats.print_sequence_number_statistics() | 313 rtp_stats.print_sequence_number_statistics() |
| 314 rtp_stats.estimate_frequency(options.query_sample_rate) | 314 rtp_stats.estimate_frequency(options.query_sample_rate) |
| 315 rtp_stats.print_duration_statistics() | 315 rtp_stats.print_duration_statistics() |
| 316 rtp_stats.remove_reordered() | 316 rtp_stats.remove_reordered() |
| 317 rtp_stats.compute_bandwidth() | 317 rtp_stats.compute_bandwidth() |
| 318 rtp_stats.plot_statistics() | 318 rtp_stats.plot_statistics() |
| 319 | 319 |
| 320 if __name__ == "__main__": | 320 if __name__ == "__main__": |
| 321 main() | 321 main() |
| OLD | NEW |