tools/perf/core/results_processor/compute_metrics.py
def ComputeTBMv2Metrics(test_result):
  """Compute metrics on aggregated traces in parallel.

  For each test run that has an aggregate trace and some TBMv2 metrics listed
  in its tags, compute the metrics and return the list of all resulting
  histograms.
  """
  artifacts = test_result.get('outputArtifacts', {})

  if test_result['status'] == 'SKIP':
    return

  metrics = [tag['value'] for tag in test_result.get('tags', [])
             if tag['key'] == 'tbmv2']
  if not metrics:
    logging.debug('%s: No TBMv2 metrics specified.', test_result['testPath'])
    return

  if HTML_TRACE_NAME not in artifacts:
    util.SetUnexpectedFailure(test_result)
    logging.error('%s: No traces to compute metrics on.',
                  test_result['testPath'])
    return

  trace_size_in_mib = (os.path.getsize(artifacts[HTML_TRACE_NAME]['filePath'])
                       / (2 ** 20))
  # Bails out on traces that are too big. See crbug.com/812631 for more
  # details.
  if trace_size_in_mib > 400:
    util.SetUnexpectedFailure(test_result)
    logging.error('%s: Trace size is too big: %s MiB',
                  test_result['testPath'], trace_size_in_mib)
    return

  start = time.time()
  test_result['_histograms'].ImportDicts(_RunMetric(test_result, metrics))
  logging.info('%s: Computing TBMv2 metrics took %.3f seconds.' % (
      test_result['testPath'], time.time() - start))
Compute metrics on aggregated traces in parallel.

  For each test run that has an aggregate trace and some TBMv2 metrics listed
  in its tags, compute the metrics and return the list of all resulting
  histograms.
  
Compute metrics on aggregated traces in parallel.
For each test run that has an aggregate trace and some TBMv2 metrics listed
in its tags, compute the metrics and return the list of all resulting
histograms.
Compute metrics on aggregated traces in parallel . For each test run that has an aggregate trace and some TBMv2 metrics listed in its tags compute the metrics and return the list of all resulting histograms .
def ComputeTBMv2Metrics(test_result):
  artifacts = test_result.get('outputArtifacts', {})
  if test_result['status'] == 'SKIP':
    return
  metrics = [tag['value'] for tag in test_result.get('tags', [])
             if tag['key'] == 'tbmv2']
  if not metrics:
    logging.debug('%s: No TBMv2 metrics specified.', test_result['testPath'])
    return
  if HTML_TRACE_NAME not in artifacts:
    util.SetUnexpectedFailure(test_result)
    logging.error('%s: No traces to compute metrics on.',
                  test_result['testPath'])
    return
  trace_size_in_mib = (os.path.getsize(artifacts[HTML_TRACE_NAME]['filePath'])
                       / (2 ** 20))
  if trace_size_in_mib > 400:
    util.SetUnexpectedFailure(test_result)
    logging.error('%s: Trace size is too big: %s MiB',
                  test_result['testPath'], trace_size_in_mib)
    return
  start = time.time()
  test_result['_histograms'].ImportDicts(_RunMetric(test_result, metrics))
  logging.info('%s: Computing TBMv2 metrics took %.3f seconds.' % (
      test_result['testPath'], time.time() - start))
def ComputeTBMv2Metrics ( test_result ) : artifacts = test_result . get ( 'outputArtifacts' , { } ) if test_result [ 'status' ] == 'SKIP' : return metrics = [ tag [ 'value' ] for tag in test_result . get ( 'tags' , [ ] ) if tag [ 'key' ] == 'tbmv2' ] if not metrics : logging . debug ( '%s: No TBMv2 metrics specified.' , test_result [ 'testPath' ] ) return if HTML_TRACE_NAME not in artifacts : util . SetUnexpectedFailure ( test_result ) logging . error ( '%s: No traces to compute metrics on.' , test_result [ 'testPath' ] ) return trace_size_in_mib = ( os . path . getsize ( artifacts [ HTML_TRACE_NAME ] [ 'filePath' ] ) / ( 2 ** 20 ) ) if trace_size_in_mib > 400 : util . SetUnexpectedFailure ( test_result ) logging . error ( '%s: Trace size is too big: %s MiB' , test_result [ 'testPath' ] , trace_size_in_mib ) return start = time . time ( ) test_result [ '_histograms' ] . ImportDicts ( _RunMetric ( test_result , metrics ) ) logging . info ( '%s: Computing TBMv2 metrics took %.3f seconds.' % ( test_result [ 'testPath' ] , time . time ( ) - start ) )
Compute metrics on aggregated traces in parallel.
Compute metrics on aggregated traces in parallel .
"""Compute metrics on aggregated traces in parallel.

  For each test run that has an aggregate trace and some TBMv2 metrics listed
  in its tags, compute the metrics and return the list of all resulting
  histograms.
  """ # Bails out on traces that are too big. See crbug.com/812631 for more # details.
test_result