tools/perf/cli_tools/flakiness_cli/frames.py
def TestResultsDataFrame(data):
  """Convert a test results request response into a data frame."""
  assert data['version'] == 4

  dfs = []
  for builder, builder_data in data.items():
    if builder == 'version':
      continue  # Skip, not a builder.
    builds = pandas.DataFrame()
    builds['timestamp'] = pandas.to_datetime(
        builder_data['secondsSinceEpoch'], unit='s')
    builds['builder'] = builder
    builds['build_number'] = builder_data['buildNumbers']
    _AddDataFrameColumn(builds, 'commit_pos', builder_data['chromeRevision'])
    for test_suite, test_case, test_results in _IterTestResults(
        builder_data['tests']):
      df = builds.copy()
      df['test_suite'] = test_suite
      df['test_case'] = test_case
      _AddDataFrameColumn(df, 'result', _RunLengthDecode(
          test_results['results']), fill_value='N')
      _AddDataFrameColumn(df, 'time', _RunLengthDecode(test_results['times']))
      dfs.append(df)

    if dfs:
      df = pandas.concat(dfs, ignore_index=True)
      assert tuple(df.columns) == TEST_RESULTS_COLUMNS
    else:
      # Return an empty data frame with the right column names otherwise.
      df = pandas.DataFrame(columns=TEST_RESULTS_COLUMNS)

    return df
Convert a test results request response into a data frame.
Convert a test results request response into a data frame.
Convert a test results request response into a data frame .
def TestResultsDataFrame(data):
  assert data['version'] == 4
  dfs = []
  for builder, builder_data in data.items():
    if builder == 'version':
      continue  
    builds = pandas.DataFrame()
    builds['timestamp'] = pandas.to_datetime(
        builder_data['secondsSinceEpoch'], unit='s')
    builds['builder'] = builder
    builds['build_number'] = builder_data['buildNumbers']
    _AddDataFrameColumn(builds, 'commit_pos', builder_data['chromeRevision'])
    for test_suite, test_case, test_results in _IterTestResults(
        builder_data['tests']):
      df = builds.copy()
      df['test_suite'] = test_suite
      df['test_case'] = test_case
      _AddDataFrameColumn(df, 'result', _RunLengthDecode(
          test_results['results']), fill_value='N')
      _AddDataFrameColumn(df, 'time', _RunLengthDecode(test_results['times']))
      dfs.append(df)
    if dfs:
      df = pandas.concat(dfs, ignore_index=True)
      assert tuple(df.columns) == TEST_RESULTS_COLUMNS
    else:
      df = pandas.DataFrame(columns=TEST_RESULTS_COLUMNS)
    return df
def TestResultsDataFrame ( data ) : assert data [ 'version' ] == 4 dfs = [ ] for builder , builder_data in data . items ( ) : if builder == 'version' : continue builds = pandas . DataFrame ( ) builds [ 'timestamp' ] = pandas . to_datetime ( builder_data [ 'secondsSinceEpoch' ] , unit = 's' ) builds [ 'builder' ] = builder builds [ 'build_number' ] = builder_data [ 'buildNumbers' ] _AddDataFrameColumn ( builds , 'commit_pos' , builder_data [ 'chromeRevision' ] ) for test_suite , test_case , test_results in _IterTestResults ( builder_data [ 'tests' ] ) : df = builds . copy ( ) df [ 'test_suite' ] = test_suite df [ 'test_case' ] = test_case _AddDataFrameColumn ( df , 'result' , _RunLengthDecode ( test_results [ 'results' ] ) , fill_value = 'N' ) _AddDataFrameColumn ( df , 'time' , _RunLengthDecode ( test_results [ 'times' ] ) ) dfs . append ( df ) if dfs : df = pandas . concat ( dfs , ignore_index = True ) assert tuple ( df . columns ) == TEST_RESULTS_COLUMNS else : df = pandas . DataFrame ( columns = TEST_RESULTS_COLUMNS ) return df
Convert a test results request response into a data frame.
Convert a test results request response into a data frame .
"""Convert a test results request response into a data frame.""" # Skip, not a builder. # Return an empty data frame with the right column names otherwise.
data