tools/fuchsia/comparative_tester/generate_perf_report.py
def TargetFromList(results: List[TargetResult]) -> TargetStats:
  """Coalesces a list of TargetResults into a single collection of stats.

  Args:
    results (List[TargetResult]): The sampling of target executions to generate
        stats for.

  Returns:
    TargetStats: The body of stats for the sample given.
  """

  name = results[0].name
  sample_num = len(results)
  tests = {}  # type: Dict[str, List[TestResult]]
  for result in results:
    assert result.name == name
    # This groups tests by name so that they can be considered independently,
    # so that in the event tests flake out, their average times can
    # still be accurately calculated
    for test in result.tests:
      if not test.name in tests.keys():
        tests[test.name] = [test]
      tests[test.name].append(test)
  test_stats = [TestFromList(test_list) for _, test_list in tests.items()]
  return TargetStats(name, sample_num, test_stats)
Coalesces a list of TargetResults into a single collection of stats.

  Args:
    results (List[TargetResult]): The sampling of target executions to generate
        stats for.

  Returns:
    TargetStats: The body of stats for the sample given.
  
Coalesces a list of TargetResults into a single collection of stats.
Coalesces a list of TargetResults into a single collection of stats .
def TargetFromList(results: List[TargetResult]) -> TargetStats:
  name = results[0].name
  sample_num = len(results)
  tests = {}  
  for result in results:
    assert result.name == name
    for test in result.tests:
      if not test.name in tests.keys():
        tests[test.name] = [test]
      tests[test.name].append(test)
  test_stats = [TestFromList(test_list) for _, test_list in tests.items()]
  return TargetStats(name, sample_num, test_stats)
def TargetFromList ( results : List [ TargetResult ] ) -> TargetStats : name = results [ 0 ] . name sample_num = len ( results ) tests = { } for result in results : assert result . name == name for test in result . tests : if not test . name in tests . keys ( ) : tests [ test . name ] = [ test ] tests [ test . name ] . append ( test ) test_stats = [ TestFromList ( test_list ) for _ , test_list in tests . items ( ) ] return TargetStats ( name , sample_num , test_stats )
Coalesces a list of TargetResults into a single collection of stats.
Coalesces a list of TargetResults into a single collection of stats .
"""Coalesces a list of TargetResults into a single collection of stats.

  Args:
    results (List[TargetResult]): The sampling of target executions to generate
        stats for.

  Returns:
    TargetStats: The body of stats for the sample given.
  """ # type: Dict[str, List[TestResult]] # This groups tests by name so that they can be considered independently, # so that in the event tests flake out, their average times can # still be accurately calculated
The body of stats for the sample given.
The body of stats for the sample given .
TargetStats
results
List[TargetResult]
The sampling of target executions to generate
stats for.
The sampling of target executions to generate stats for .