tools/perf/experimental/representative_perf_test_limit_adjuster/adjust_upper_limits.py
def GetPercentileValues(data_frame, percentile):
  """Get the percentile value of each metric for recorded values in dataframe.

  Args:
    data_frame: The dataframe with averages and confidence intervals of each
    story of each run.
    percentile: the percentile to use for determining the upper limits.

  Returns:
    A dictionary with averages and confidence interval ranges calculated
    from the percentile of recent runs.
  """

  if not data_frame.empty:
    avg_df = data_frame.pivot(index='stories', columns='index', values='avg')
    upper_limit = avg_df.quantile(percentile, axis = 1)
    ci_df = data_frame.pivot(index='stories', columns='index', values='ci_095')
    upper_limit_ci = ci_df.quantile(percentile, axis = 1)
    cpu_wall_df = data_frame.pivot(index='stories',
                                   columns='index',
                                   values='cpu_wall_time_ratio')
    upper_limit_cpu_wall = cpu_wall_df.quantile(1 - percentile, axis=1)

    results = {}
    for index in avg_df.index:
      results[index] = {
          'avg': round(upper_limit[index], 3),
          'ci_095': round(upper_limit_ci[index], 3),
          'cpu_wall_time_ratio': round(upper_limit_cpu_wall[index], 3)
      }
    return results
Get the percentile value of each metric for recorded values in dataframe.

  Args:
    data_frame: The dataframe with averages and confidence intervals of each
    story of each run.
    percentile: the percentile to use for determining the upper limits.

  Returns:
    A dictionary with averages and confidence interval ranges calculated
    from the percentile of recent runs.
  
Get the percentile value of each metric for recorded values in dataframe.
Args:
data_frame: The dataframe with averages and confidence intervals of each
story of each run.
percentile: the percentile to use for determining the upper limits.

A dictionary with averages and confidence interval ranges calculated
from the percentile of recent runs.
Get the percentile value of each metric for recorded values in dataframe . Args : data_frame : The dataframe with averages and confidence intervals of each story of each run . percentile : the percentile to use for determining the upper limits . A dictionary with averages and confidence interval ranges calculated from the percentile of recent runs .
def GetPercentileValues(data_frame, percentile):
  if not data_frame.empty:
    avg_df = data_frame.pivot(index='stories', columns='index', values='avg')
    upper_limit = avg_df.quantile(percentile, axis = 1)
    ci_df = data_frame.pivot(index='stories', columns='index', values='ci_095')
    upper_limit_ci = ci_df.quantile(percentile, axis = 1)
    cpu_wall_df = data_frame.pivot(index='stories',
                                   columns='index',
                                   values='cpu_wall_time_ratio')
    upper_limit_cpu_wall = cpu_wall_df.quantile(1 - percentile, axis=1)
    results = {}
    for index in avg_df.index:
      results[index] = {
          'avg': round(upper_limit[index], 3),
          'ci_095': round(upper_limit_ci[index], 3),
          'cpu_wall_time_ratio': round(upper_limit_cpu_wall[index], 3)
      }
    return results
def GetPercentileValues ( data_frame , percentile ) : if not data_frame . empty : avg_df = data_frame . pivot ( index = 'stories' , columns = 'index' , values = 'avg' ) upper_limit = avg_df . quantile ( percentile , axis = 1 ) ci_df = data_frame . pivot ( index = 'stories' , columns = 'index' , values = 'ci_095' ) upper_limit_ci = ci_df . quantile ( percentile , axis = 1 ) cpu_wall_df = data_frame . pivot ( index = 'stories' , columns = 'index' , values = 'cpu_wall_time_ratio' ) upper_limit_cpu_wall = cpu_wall_df . quantile ( 1 - percentile , axis = 1 ) results = { } for index in avg_df . index : results [ index ] = { 'avg' : round ( upper_limit [ index ] , 3 ) , 'ci_095' : round ( upper_limit_ci [ index ] , 3 ) , 'cpu_wall_time_ratio' : round ( upper_limit_cpu_wall [ index ] , 3 ) } return results
Get the percentile value of each metric for recorded values in dataframe.
Get the percentile value of each metric for recorded values in dataframe .
"""Get the percentile value of each metric for recorded values in dataframe.

  Args:
    data_frame: The dataframe with averages and confidence intervals of each
    story of each run.
    percentile: the percentile to use for determining the upper limits.

  Returns:
    A dictionary with averages and confidence interval ranges calculated
    from the percentile of recent runs.
  """
data_frame
percentile