tools/perf/core/results_processor/formatters/csv_output.py
def ProcessHistogramDicts(histogram_dicts, options):
  """Convert histogram dicts to CSV and write output in output_dir."""
  with tempfile_ext.NamedTemporaryFile(mode='w') as hist_file:
    json.dump(histogram_dicts, hist_file)
    hist_file.close()
    vinn_result = histograms_to_csv.HistogramsToCsv(hist_file.name)
    csv_dicts = _ReadCsv(vinn_result.stdout.decode('utf-8').splitlines())

  output_file = os.path.join(options.output_dir, OUTPUT_FILENAME)
  if not options.reset_results and os.path.isfile(output_file):
    with open(output_file) as input_stream:
      csv_dicts += _ReadCsv(input_stream)

  with open(output_file, 'w') as output_stream:
    _WriteCsv(csv_dicts, output_stream)

  return output_file
Convert histogram dicts to CSV and write output in output_dir.
Convert histogram dicts to CSV and write output in output_dir.
Convert histogram dicts to CSV and write output in output_dir .
def ProcessHistogramDicts(histogram_dicts, options):
  with tempfile_ext.NamedTemporaryFile(mode='w') as hist_file:
    json.dump(histogram_dicts, hist_file)
    hist_file.close()
    vinn_result = histograms_to_csv.HistogramsToCsv(hist_file.name)
    csv_dicts = _ReadCsv(vinn_result.stdout.decode('utf-8').splitlines())
  output_file = os.path.join(options.output_dir, OUTPUT_FILENAME)
  if not options.reset_results and os.path.isfile(output_file):
    with open(output_file) as input_stream:
      csv_dicts += _ReadCsv(input_stream)
  with open(output_file, 'w') as output_stream:
    _WriteCsv(csv_dicts, output_stream)
  return output_file
def ProcessHistogramDicts ( histogram_dicts , options ) : with tempfile_ext . NamedTemporaryFile ( mode = 'w' ) as hist_file : json . dump ( histogram_dicts , hist_file ) hist_file . close ( ) vinn_result = histograms_to_csv . HistogramsToCsv ( hist_file . name ) csv_dicts = _ReadCsv ( vinn_result . stdout . decode ( 'utf-8' ) . splitlines ( ) ) output_file = os . path . join ( options . output_dir , OUTPUT_FILENAME ) if not options . reset_results and os . path . isfile ( output_file ) : with open ( output_file ) as input_stream : csv_dicts += _ReadCsv ( input_stream ) with open ( output_file , 'w' ) as output_stream : _WriteCsv ( csv_dicts , output_stream ) return output_file
Convert histogram dicts to CSV and write output in output_dir.
Convert histogram dicts to CSV and write output in output_dir .
"""Convert histogram dicts to CSV and write output in output_dir."""
histogram_dicts
options