| 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 """Generate graphs for data generated by loopback tests. |   10 """Generate graphs for data generated by loopback tests. | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
|   27  |   27  | 
|   28 import argparse |   28 import argparse | 
|   29 from collections import defaultdict |   29 from collections import defaultdict | 
|   30 import itertools |   30 import itertools | 
|   31 import sys |   31 import sys | 
|   32 import matplotlib.pyplot as plt |   32 import matplotlib.pyplot as plt | 
|   33 import numpy |   33 import numpy | 
|   34  |   34  | 
|   35 # Fields |   35 # Fields | 
|   36 DROPPED = 0 |   36 DROPPED = 0 | 
|   37 INPUT_TIME = 1              # ms (timestamp) |   37 INPUT_TIME = 1              # ms | 
|   38 SEND_TIME = 2               # ms (timestamp) |   38 SEND_TIME = 2               # ms | 
|   39 RECV_TIME = 3               # ms (timestamp) |   39 RECV_TIME = 3               # ms | 
|   40 RENDER_TIME = 4             # ms (timestamp) |   40 ENCODED_FRAME_SIZE = 4      # bytes | 
|   41 ENCODED_FRAME_SIZE = 5      # bytes |   41 PSNR = 5 | 
|   42 PSNR = 6 |   42 SSIM = 6 | 
|   43 SSIM = 7 |   43 RENDER_TIME = 7             # ms | 
|   44 ENCODE_TIME = 8             # ms (time interval) |  | 
|   45  |   44  | 
|   46 TOTAL_RAW_FIELDS = 9 |   45 TOTAL_RAW_FIELDS = 8 | 
|   47  |   46  | 
|   48 SENDER_TIME = TOTAL_RAW_FIELDS + 0 |   47 SENDER_TIME = TOTAL_RAW_FIELDS + 0 | 
|   49 RECEIVER_TIME = TOTAL_RAW_FIELDS + 1 |   48 RECEIVER_TIME = TOTAL_RAW_FIELDS + 1 | 
|   50 END_TO_END = TOTAL_RAW_FIELDS + 2 |   49 END_TO_END = TOTAL_RAW_FIELDS + 2 | 
|   51 RENDERED_DELTA = TOTAL_RAW_FIELDS + 3 |   50 RENDERED_DELTA = TOTAL_RAW_FIELDS + 3 | 
|   52  |   51  | 
|   53 FIELD_MASK = 255 |   52 FIELD_MASK = 255 | 
|   54  |   53  | 
|   55 # Options |   54 # Options | 
|   56 HIDE_DROPPED = 256 |   55 HIDE_DROPPED = 256 | 
|   57 RIGHT_Y_AXIS = 512 |   56 RIGHT_Y_AXIS = 512 | 
|   58  |   57  | 
|   59 # internal field id, field name, title |   58 # internal field id, field name, title | 
|   60 _fields = [ |   59 _fields = [ | 
|   61     # Raw |   60     # Raw | 
|   62     (DROPPED, "dropped", "dropped"), |   61     (DROPPED, "dropped", "dropped"), | 
|   63     (INPUT_TIME, "input_time_ms", "input time"), |   62     (INPUT_TIME, "input_time_ms", "input time"), | 
|   64     (SEND_TIME, "send_time_ms", "send time"), |   63     (SEND_TIME, "send_time_ms", "send time"), | 
|   65     (RECV_TIME, "recv_time_ms", "recv time"), |   64     (RECV_TIME, "recv_time_ms", "recv time"), | 
|   66     (ENCODED_FRAME_SIZE, "encoded_frame_size", "encoded frame size"), |   65     (ENCODED_FRAME_SIZE, "encoded_frame_size", "encoded frame size"), | 
|   67     (PSNR, "psnr", "PSNR"), |   66     (PSNR, "psnr", "PSNR"), | 
|   68     (SSIM, "ssim", "SSIM"), |   67     (SSIM, "ssim", "SSIM"), | 
|   69     (RENDER_TIME, "render_time_ms", "render time"), |   68     (RENDER_TIME, "render_time_ms", "render time"), | 
|   70     (ENCODE_TIME, "encode_time_ms", "encode time"), |  | 
|   71     # Auto-generated |   69     # Auto-generated | 
|   72     (SENDER_TIME, "sender_time", "sender time"), |   70     (SENDER_TIME, "sender_time", "sender time"), | 
|   73     (RECEIVER_TIME, "receiver_time", "receiver time"), |   71     (RECEIVER_TIME, "receiver_time", "receiver time"), | 
|   74     (END_TO_END, "end_to_end", "end to end"), |   72     (END_TO_END, "end_to_end", "end to end"), | 
|   75     (RENDERED_DELTA, "rendered_delta", "rendered delta"), |   73     (RENDERED_DELTA, "rendered_delta", "rendered delta"), | 
|   76 ] |   74 ] | 
|   77  |   75  | 
|   78 name_to_id = {field[1]: field[0] for field in _fields} |   76 name_to_id = {field[1]: field[0] for field in _fields} | 
|   79 id_to_title = {field[0]: field[2] for field in _fields} |   77 id_to_title = {field[0]: field[2] for field in _fields} | 
|   80  |   78  | 
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  405     config.plot(ax) |  403     config.plot(ax) | 
|  406     if config.output_filename: |  404     if config.output_filename: | 
|  407       print "Saving to", config.output_filename |  405       print "Saving to", config.output_filename | 
|  408       fig.savefig(config.output_filename) |  406       fig.savefig(config.output_filename) | 
|  409       plt.close(fig) |  407       plt.close(fig) | 
|  410  |  408  | 
|  411   plt.show() |  409   plt.show() | 
|  412  |  410  | 
|  413 if __name__ == "__main__": |  411 if __name__ == "__main__": | 
|  414   show_or_save_plots(plot_configs_from_args(sys.argv[1:])) |  412   show_or_save_plots(plot_configs_from_args(sys.argv[1:])) | 
| OLD | NEW |