tools/fuchsia/comparative_tester/generate_perf_report.py
def TestFromList(tests: List[TestResult]) -> TestStats:
  """Coalesces a list of TestResults into a single TestStats object.

  Args:
    tests (List[TestResult]): The input sample of the tests.

  Returns:
    TestStats: A representation of the statistics of the tests.
  """

  name = tests[0].name
  avg, dev, cv = GenStats([test.time for test in tests])
  lines = {}  # type: Dict[str, List[ResultLine]]
  for test in tests:
    assert test.name == name
    for line in test.lines:
      if not line.desc in lines:
        lines[line.desc] = [line]
      else:
        lines[line.desc].append(line)
  test_lines = []
  for _, line_list in lines.items():
    stat_line = LineFromList(line_list)
    if stat_line:
      test_lines.append(stat_line)
  return TestStats(name, avg, dev, cv, len(tests), test_lines)
Coalesces a list of TestResults into a single TestStats object.

  Args:
    tests (List[TestResult]): The input sample of the tests.

  Returns:
    TestStats: A representation of the statistics of the tests.
  
Coalesces a list of TestResults into a single TestStats object.
Coalesces a list of TestResults into a single TestStats object .
def TestFromList(tests: List[TestResult]) -> TestStats:
  name = tests[0].name
  avg, dev, cv = GenStats([test.time for test in tests])
  lines = {}  
  for test in tests:
    assert test.name == name
    for line in test.lines:
      if not line.desc in lines:
        lines[line.desc] = [line]
      else:
        lines[line.desc].append(line)
  test_lines = []
  for _, line_list in lines.items():
    stat_line = LineFromList(line_list)
    if stat_line:
      test_lines.append(stat_line)
  return TestStats(name, avg, dev, cv, len(tests), test_lines)
def TestFromList ( tests : List [ TestResult ] ) -> TestStats : name = tests [ 0 ] . name avg , dev , cv = GenStats ( [ test . time for test in tests ] ) lines = { } for test in tests : assert test . name == name for line in test . lines : if not line . desc in lines : lines [ line . desc ] = [ line ] else : lines [ line . desc ] . append ( line ) test_lines = [ ] for _ , line_list in lines . items ( ) : stat_line = LineFromList ( line_list ) if stat_line : test_lines . append ( stat_line ) return TestStats ( name , avg , dev , cv , len ( tests ) , test_lines )
Coalesces a list of TestResults into a single TestStats object.
Coalesces a list of TestResults into a single TestStats object .
"""Coalesces a list of TestResults into a single TestStats object.

  Args:
    tests (List[TestResult]): The input sample of the tests.

  Returns:
    TestStats: A representation of the statistics of the tests.
  """ # type: Dict[str, List[ResultLine]]
A representation of the statistics of the tests.
A representation of the statistics of the tests .
TestStats
tests
List[TestResult]
The input sample of the tests.
The input sample of the tests .