tools/fuchsia/comparative_tester/generate_perf_report.py
def CompareTests(linux: TestStats, fuchsia: TestStats) -> Dict[str, Any]:
  """As CompareTargets, but at the test level"""
  if not linux and not fuchsia:
    logging.error("Two null TestStats objects were passed to CompareTests.")
    return {}

  if not linux or not fuchsia:
    if linux:
      name = linux.name
      failing_os = "Fuchsia"
    else:
      name = fuchsia.name
      failing_os = "Linux"
    logging.error("%s failed to produce output for the test %s",
                  failing_os, name)
    return {}

  assert linux.name == fuchsia.name
  paired_lines = ZipListsByPredicate(linux.lines, fuchsia.lines,
                                     lambda line: line.desc)
  paired_lines = MapDictValues(paired_lines, CompareLines)
  result = {"lines": paired_lines, "unit": "ms"}  # type: Dict[str, Any]

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

  if fuchsia == None:
    logging.warning("Fuchsia is missing test case {}".format(linux.name))
  else:
    result["name"] = fuchsia.name
    result["fuchsia_avg"] = fuchsia.time_avg
    result["fuchsia_dev"] = fuchsia.time_dev
    result["fuchsia_cv"] = fuchsia.cv
  return result
As CompareTargets, but at the test level
As CompareTargets, but at the test level
As CompareTargets but at the test level
def CompareTests(linux: TestStats, fuchsia: TestStats) -> Dict[str, Any]:
  if not linux and not fuchsia:
    logging.error("Two null TestStats objects were passed to CompareTests.")
    return {}
  if not linux or not fuchsia:
    if linux:
      name = linux.name
      failing_os = "Fuchsia"
    else:
      name = fuchsia.name
      failing_os = "Linux"
    logging.error("%s failed to produce output for the test %s",
                  failing_os, name)
    return {}
  assert linux.name == fuchsia.name
  paired_lines = ZipListsByPredicate(linux.lines, fuchsia.lines,
                                     lambda line: line.desc)
  paired_lines = MapDictValues(paired_lines, CompareLines)
  result = {"lines": paired_lines, "unit": "ms"}  
  if linux:
    result["name"] = linux.name
    result["linux_avg"] = linux.time_avg
    result["linux_dev"] = linux.time_dev
    result["linux_cv"] = linux.cv
  if fuchsia == None:
    logging.warning("Fuchsia is missing test case {}".format(linux.name))
  else:
    result["name"] = fuchsia.name
    result["fuchsia_avg"] = fuchsia.time_avg
    result["fuchsia_dev"] = fuchsia.time_dev
    result["fuchsia_cv"] = fuchsia.cv
  return result
def CompareTests ( linux : TestStats , fuchsia : TestStats ) -> Dict [ str , Any ] : if not linux and not fuchsia : logging . error ( "Two null TestStats objects were passed to CompareTests." ) return { } if not linux or not fuchsia : if linux : name = linux . name failing_os = "Fuchsia" else : name = fuchsia . name failing_os = "Linux" logging . error ( "%s failed to produce output for the test %s" , failing_os , name ) return { } assert linux . name == fuchsia . name paired_lines = ZipListsByPredicate ( linux . lines , fuchsia . lines , lambda line : line . desc ) paired_lines = MapDictValues ( paired_lines , CompareLines ) result = { "lines" : paired_lines , "unit" : "ms" } if linux : result [ "name" ] = linux . name result [ "linux_avg" ] = linux . time_avg result [ "linux_dev" ] = linux . time_dev result [ "linux_cv" ] = linux . cv if fuchsia == None : logging . warning ( "Fuchsia is missing test case {}" . format ( linux . name ) ) else : result [ "name" ] = fuchsia . name result [ "fuchsia_avg" ] = fuchsia . time_avg result [ "fuchsia_dev" ] = fuchsia . time_dev result [ "fuchsia_cv" ] = fuchsia . cv return result
As CompareTargets, but at the test level
As CompareTargets but at the test level
"""As CompareTargets, but at the test level""" # type: Dict[str, Any]
linux
TestStats
fuchsia
TestStats