+ if 'id' and 'data' in json_message:
+ total_raw_json_size += len(line)
+ binary_message = openxc_pb2.RawMessage()
+ binary_message.message_id = json_message['id']
+ binary_message.data = int(json_message['data'], 0)
+ total_raw_binary_size += len(binary_message.SerializeToString())
+ else:
+ if isinstance(json_message['value'], bool):
+ binary_message = openxc_pb2.TranslatedBooleanMessage()
+ elif isinstance(json_message['value'], numbers.Number):
+ binary_message = openxc_pb2.TranslatedNumericMessage()
+ else:
+ binary_message = openxc_pb2.TranslatedStringMessage()
+ binary_message.name = json_message['name']
+ binary_message.value = json_message['value']
+ total_translated_json_size += len(line)
+ total_translated_binary_size += len(binary_message.SerializeToString())
+
+
+print("For the %d trace files given..." % len(sys.argv[1:]))
+print("Total transferred raw JSON size is %s" % sizeof_fmt(total_raw_json_size))
+print("Total transferred raw binary size is %s" % sizeof_fmt(total_raw_binary_size))
+print("Total transferred translated JSON size is %s" %
+ sizeof_fmt(total_translated_json_size))
+print("Total transferred translated binary size is %s" %
+ sizeof_fmt(total_translated_binary_size))
+
+total_json_size = total_raw_json_size + total_translated_json_size