tools/fuchsia/comparative_tester/generate_perf_report.py
def CompareLines(linux: LineStats, fuchsia: LineStats) -> Dict[str, Any]:
  """CompareLines wraps two LineStats objects up as a JSON-dumpable dict.
  It also logs a warning every time a line is given which can't be matched up.
  If both lines passed are None, or their units or descriptions are not the same
  (which should never happen) this function fails.
  """
  if linux != None and fuchsia != None:
    assert linux.desc == fuchsia.desc
    assert linux.unit == fuchsia.unit
  assert linux != None or fuchsia != None

  # ref_test is because we don't actually care which test we get the values
  # from, as long as we get values for the name and description
  ref_test = linux if linux else fuchsia
  result = {"desc": ref_test.desc, "unit": ref_test.unit}

  if fuchsia == None:
    logging.warning("Fuchsia is missing test line {}".format(linux.desc))
  else:
    result["fuchsia_avg"] = fuchsia.time_avg
    result["fuchsia_dev"] = fuchsia.time_dev
    result["fuchsia_cv"] = fuchsia.cv

  if linux:
    result["linux_avg"] = linux.time_avg
    result["linux_dev"] = linux.time_dev
    result["linux_cv"] = linux.cv

  return result
CompareLines wraps two LineStats objects up as a JSON-dumpable dict.
  It also logs a warning every time a line is given which can't be matched up.
  If both lines passed are None, or their units or descriptions are not the same
  (which should never happen) this function fails.
  
CompareLines wraps two LineStats objects up as a JSON-dumpable dict.
It also logs a warning every time a line is given which can't be matched up.
If both lines passed are None, or their units or descriptions are not the same
(which should never happen) this function fails.
CompareLines wraps two LineStats objects up as a JSON - dumpable dict . It also logs a warning every time a line is given which can ' t be matched up . If both lines passed are None or their units or descriptions are not the same ( which should never happen ) this function fails .
def CompareLines(linux: LineStats, fuchsia: LineStats) -> Dict[str, Any]:
  if linux != None and fuchsia != None:
    assert linux.desc == fuchsia.desc
    assert linux.unit == fuchsia.unit
  assert linux != None or fuchsia != None
  ref_test = linux if linux else fuchsia
  result = {"desc": ref_test.desc, "unit": ref_test.unit}
  if fuchsia == None:
    logging.warning("Fuchsia is missing test line {}".format(linux.desc))
  else:
    result["fuchsia_avg"] = fuchsia.time_avg
    result["fuchsia_dev"] = fuchsia.time_dev
    result["fuchsia_cv"] = fuchsia.cv
  if linux:
    result["linux_avg"] = linux.time_avg
    result["linux_dev"] = linux.time_dev
    result["linux_cv"] = linux.cv
  return result
def CompareLines ( linux : LineStats , fuchsia : LineStats ) -> Dict [ str , Any ] : if linux != None and fuchsia != None : assert linux . desc == fuchsia . desc assert linux . unit == fuchsia . unit assert linux != None or fuchsia != None ref_test = linux if linux else fuchsia result = { "desc" : ref_test . desc , "unit" : ref_test . unit } if fuchsia == None : logging . warning ( "Fuchsia is missing test line {}" . format ( linux . desc ) ) else : result [ "fuchsia_avg" ] = fuchsia . time_avg result [ "fuchsia_dev" ] = fuchsia . time_dev result [ "fuchsia_cv" ] = fuchsia . cv if linux : result [ "linux_avg" ] = linux . time_avg result [ "linux_dev" ] = linux . time_dev result [ "linux_cv" ] = linux . cv return result
CompareLines wraps two LineStats objects up as a JSON-dumpable dict.
CompareLines wraps two LineStats objects up as a JSON - dumpable dict .
"""CompareLines wraps two LineStats objects up as a JSON-dumpable dict.
  It also logs a warning every time a line is given which can't be matched up.
  If both lines passed are None, or their units or descriptions are not the same
  (which should never happen) this function fails.
  """ # ref_test is because we don't actually care which test we get the values # from, as long as we get values for the name and description
linux
LineStats
fuchsia
LineStats