68 logging.basicConfig(stream=sys.stdout,
69 format=
'%(levelname)-8s %(message)s',
72 ros_stats = LastUpdatedOrderedDict()
74 lines =
get_lines(
r'^\s*ROS-',
'ros_hitstats_reject.txt')
78 name = row[LookUpDict.ROS_NAME]
79 hit_rate = row[LookUpDict.TOTAL_ROB_FRAC_PER_EVT]
80 data_rate = row[LookUpDict.TOTAL_BYTES_PER_EVT]
81 ros_stats[name] = LastUpdatedOrderedDict({
82 'hits-per-evt': hit_rate,
83 'kbytes-per-evt':
float(data_rate)/1000
86 data = LastUpdatedOrderedDict()
87 output_file =
'extra-results.json'
88 if os.path.isfile(output_file):
89 with open(output_file)
as f:
90 data.update(json.load(f, object_pairs_hook=LastUpdatedOrderedDict))
92 data.update({
'ros-stats': ros_stats})
94 with open(output_file,
'w')
as f:
95 json.dump(data, f, indent=4)