src/build/lacros/lacros_resource_sizes.py
def _dump_chart_json(output_dir, chartjson):
  """Writes chart histogram to JSON files.

  Output files:
    results-chart.json contains the chart JSON.
    perf_results.json contains histogram JSON for Catapult.

  Args:
    output_dir: Directory to place the JSON files.
    chartjson: Source JSON data for output files.
  """
  results_path = os.path.join(output_dir, 'results-chart.json')
  logging.critical('Dumping chartjson to %s', results_path)
  with open(results_path, 'w') as json_file:
    json.dump(chartjson, json_file, indent=2)

  # We would ideally generate a histogram set directly instead of generating
  # chartjson then converting. However, perf_tests_results_helper is in
  # //build, which doesn't seem to have any precedent for depending on
  # anything in Catapult. This can probably be fixed, but since this doesn't
  # need to be super fast or anything, converting is a good enough solution
  # for the time being.
  histogram_result = convert_chart_json.ConvertChartJson(results_path)
  if histogram_result.returncode != 0:
    raise Exception('chartjson conversion failed with error: ' +
                    histogram_result.stdout)

  histogram_path = os.path.join(output_dir, 'perf_results.json')
  logging.critical('Dumping histograms to %s', histogram_path)
  with open(histogram_path, 'w') as json_file:
    json_file.write(histogram_result.stdout)
Writes chart histogram to JSON files.

  Output files:
    results-chart.json contains the chart JSON.
    perf_results.json contains histogram JSON for Catapult.

  Args:
    output_dir: Directory to place the JSON files.
    chartjson: Source JSON data for output files.
  
Writes chart histogram to JSON files.
Output files:
results-chart.json contains the chart JSON.
perf_results.json contains histogram JSON for Catapult.
Writes chart histogram to JSON files . Output files : results - chart . json contains the chart JSON . perf_results . json contains histogram JSON for Catapult .
def _dump_chart_json(output_dir, chartjson):
  results_path = os.path.join(output_dir, 'results-chart.json')
  logging.critical('Dumping chartjson to %s', results_path)
  with open(results_path, 'w') as json_file:
    json.dump(chartjson, json_file, indent=2)
  histogram_result = convert_chart_json.ConvertChartJson(results_path)
  if histogram_result.returncode != 0:
    raise Exception('chartjson conversion failed with error: ' +
                    histogram_result.stdout)
  histogram_path = os.path.join(output_dir, 'perf_results.json')
  logging.critical('Dumping histograms to %s', histogram_path)
  with open(histogram_path, 'w') as json_file:
    json_file.write(histogram_result.stdout)
def _dump_chart_json ( output_dir , chartjson ) : results_path = os . path . join ( output_dir , 'results-chart.json' ) logging . critical ( 'Dumping chartjson to %s' , results_path ) with open ( results_path , 'w' ) as json_file : json . dump ( chartjson , json_file , indent = 2 ) histogram_result = convert_chart_json . ConvertChartJson ( results_path ) if histogram_result . returncode != 0 : raise Exception ( 'chartjson conversion failed with error: ' + histogram_result . stdout ) histogram_path = os . path . join ( output_dir , 'perf_results.json' ) logging . critical ( 'Dumping histograms to %s' , histogram_path ) with open ( histogram_path , 'w' ) as json_file : json_file . write ( histogram_result . stdout )
Writes chart histogram to JSON files.
Writes chart histogram to JSON files .
"""Writes chart histogram to JSON files.

  Output files:
    results-chart.json contains the chart JSON.
    perf_results.json contains histogram JSON for Catapult.

  Args:
    output_dir: Directory to place the JSON files.
    chartjson: Source JSON data for output files.
  """ # We would ideally generate a histogram set directly instead of generating # chartjson then converting. However, perf_tests_results_helper is in # //build, which doesn't seem to have any precedent for depending on # anything in Catapult. This can probably be fixed, but since this doesn't # need to be super fast or anything, converting is a good enough solution # for the time being.
output_dir
Directory to place the JSON files.
Directory to place the JSON files .
chartjson
Source JSON data for output files.
Source JSON data for output files .