tools/perf/cli_tools/pinboard/pinboard.py
def AggregateAndUploadResults(new_items, cached_df=None):
  """Aggregate results collected and upload them to cloud storage."""
  dfs = []
  if cached_df is not None:
    dfs.append(cached_df)

  found_new = False
  for item in new_items:
    if _SkipProcessing(item):  # Jobs are not ready, or all have failed.
      continue
    if not found_new:
      logging.info('Processing data from new results:')
      found_new = True
    logging.info('- %s (%s)', item['timestamp'][:10], item['revision'])
    dfs.append(GetRevisionResults(item))

  if not found_new:
    logging.info('No new data found.')
    return

  # Otherwise update our cache and upload.
  df = pd.concat(dfs, ignore_index=True)
  UpdateCachedDataset(df)

  # Drop revisions with no results and mark the last result for each metric,
  # both with/without patch, as a 'reference'. This allows making score cards
  # comparing their most recent results in Data Studio dashboards.
  df = df[df['count'] > 0].copy()
  latest_result = df.groupby(
      ['label', 'benchmark', 'name'])['timestamp'].transform('max')
  df['reference'] = df['timestamp'] == latest_result

  dataset_file = CachedFilePath(DATASET_CSV_FILE)
  df.to_csv(dataset_file, index=False)
  UploadToCloudStorage(dataset_file)
  logging.info('Total %s rows of data uploaded.' % len(df.index))
Aggregate results collected and upload them to cloud storage.
Aggregate results collected and upload them to cloud storage.
Aggregate results collected and upload them to cloud storage .
def AggregateAndUploadResults(new_items, cached_df=None):
  dfs = []
  if cached_df is not None:
    dfs.append(cached_df)
  found_new = False
  for item in new_items:
    if _SkipProcessing(item):  
      continue
    if not found_new:
      logging.info('Processing data from new results:')
      found_new = True
    logging.info('- %s (%s)', item['timestamp'][:10], item['revision'])
    dfs.append(GetRevisionResults(item))
  if not found_new:
    logging.info('No new data found.')
    return
  df = pd.concat(dfs, ignore_index=True)
  UpdateCachedDataset(df)
  df = df[df['count'] > 0].copy()
  latest_result = df.groupby(
      ['label', 'benchmark', 'name'])['timestamp'].transform('max')
  df['reference'] = df['timestamp'] == latest_result
  dataset_file = CachedFilePath(DATASET_CSV_FILE)
  df.to_csv(dataset_file, index=False)
  UploadToCloudStorage(dataset_file)
  logging.info('Total %s rows of data uploaded.' % len(df.index))
def AggregateAndUploadResults ( new_items , cached_df = None ) : dfs = [ ] if cached_df is not None : dfs . append ( cached_df ) found_new = False for item in new_items : if _SkipProcessing ( item ) : continue if not found_new : logging . info ( 'Processing data from new results:' ) found_new = True logging . info ( '- %s (%s)' , item [ 'timestamp' ] [ : 10 ] , item [ 'revision' ] ) dfs . append ( GetRevisionResults ( item ) ) if not found_new : logging . info ( 'No new data found.' ) return df = pd . concat ( dfs , ignore_index = True ) UpdateCachedDataset ( df ) df = df [ df [ 'count' ] > 0 ] . copy ( ) latest_result = df . groupby ( [ 'label' , 'benchmark' , 'name' ] ) [ 'timestamp' ] . transform ( 'max' ) df [ 'reference' ] = df [ 'timestamp' ] == latest_result dataset_file = CachedFilePath ( DATASET_CSV_FILE ) df . to_csv ( dataset_file , index = False ) UploadToCloudStorage ( dataset_file ) logging . info ( 'Total %s rows of data uploaded.' % len ( df . index ) )
Aggregate results collected and upload them to cloud storage.
Aggregate results collected and upload them to cloud storage .
"""Aggregate results collected and upload them to cloud storage.""" # Jobs are not ready, or all have failed. # Otherwise update our cache and upload. # Drop revisions with no results and mark the last result for each metric, # both with/without patch, as a 'reference'. This allows making score cards # comparing their most recent results in Data Studio dashboards.
new_items
cached_df