tools/perf/core/benchmark_runner_test.py
def RunBenchmark(self, benchmark_class):
    """Run a benchmark, process results, and return generated histograms."""
    # TODO(crbug.com/985712): Ideally we should be able to just call
    # telemetry.command_line.RunCommand(self.options) with the right set
    # of options chosen. However, argument parsing and command running are
    # currently tangled in Telemetry. In particular the class property
    # Run._benchmark is not set when we skip argument parsing, and the Run.Run
    # method call fails. Simplify this when argument parsing and command
    # running are no longer intertwined like this.
    run_return_code = benchmark_class().Run(self.options)
    self.assertEqual(run_return_code, 0)

    process_return_code = results_processor.ProcessResults(self.options,
                                                           is_unittest=True)
    self.assertEqual(process_return_code, 0)

    histograms_file = os.path.join(self.options.output_dir, 'histograms.json')
    self.assertTrue(os.path.exists(histograms_file))

    with open(histograms_file) as f:
      dicts = json.load(f)
    histograms = histogram_set.HistogramSet()
    histograms.ImportDicts(dicts)
    return histograms
Run a benchmark, process results, and return generated histograms.
Run a benchmark, process results, and return generated histograms.
Run a benchmark process results and return generated histograms .
def RunBenchmark(self, benchmark_class):
    run_return_code = benchmark_class().Run(self.options)
    self.assertEqual(run_return_code, 0)
    process_return_code = results_processor.ProcessResults(self.options,
                                                           is_unittest=True)
    self.assertEqual(process_return_code, 0)
    histograms_file = os.path.join(self.options.output_dir, 'histograms.json')
    self.assertTrue(os.path.exists(histograms_file))
    with open(histograms_file) as f:
      dicts = json.load(f)
    histograms = histogram_set.HistogramSet()
    histograms.ImportDicts(dicts)
    return histograms
def RunBenchmark ( self , benchmark_class ) : run_return_code = benchmark_class ( ) . Run ( self . options ) self . assertEqual ( run_return_code , 0 ) process_return_code = results_processor . ProcessResults ( self . options , is_unittest = True ) self . assertEqual ( process_return_code , 0 ) histograms_file = os . path . join ( self . options . output_dir , 'histograms.json' ) self . assertTrue ( os . path . exists ( histograms_file ) ) with open ( histograms_file ) as f : dicts = json . load ( f ) histograms = histogram_set . HistogramSet ( ) histograms . ImportDicts ( dicts ) return histograms
Run a benchmark, process results, and return generated histograms.
Run a benchmark process results and return generated histograms .
"""Run a benchmark, process results, and return generated histograms.""" # TODO(crbug.com/985712): Ideally we should be able to just call # telemetry.command_line.RunCommand(self.options) with the right set # of options chosen. However, argument parsing and command running are # currently tangled in Telemetry. In particular the class property # Run._benchmark is not set when we skip argument parsing, and the Run.Run # method call fails. Simplify this when argument parsing and command # running are no longer intertwined like this.
self
benchmark_class