예제 #1
0
def Main():
    log_util.ConfigureBasicLogging()
    _InjectBenchmarkInfoIntoDocumentation()
    _ParseFlags()
    CheckVersionFlag()
    SetUpPKB()
    return RunBenchmarks()
예제 #2
0
def Main():
  log_util.ConfigureBasicLogging()
  _InjectBenchmarkInfoIntoDocumentation()
  _ParseFlags()
  if FLAGS.helpmatch:
    _PrintHelp(FLAGS.helpmatch)
    return 0
  CheckVersionFlag()
  SetUpPKB()
  return RunBenchmarks()
예제 #3
0
  for sample in samples:
    # Chop '|' at the beginning and end of labels and split labels by '|,|'
    fields = sample.pop('labels')[1:-1].split('|,|')
    # Turn the fields into [[key, value], ...]
    key_values = [field.split(':', 1) for field in fields]
    sample['metadata'] = {k: v for k, v in key_values}

  # We can't use a SampleCollector because SampleCollector.AddSamples depends on
  # having a benchmark and a benchmark_spec.
  publishers = SampleCollector._PublishersFromFlags()
  for publisher in publishers:
    publisher.PublishSamples(samples)


if __name__ == '__main__':
  log_util.ConfigureBasicLogging()

  try:
    argv = FLAGS(sys.argv)
  except flags.Error as e:
    logging.error(e)
    logging.info('Flag error. Usage: publisher.py <flags> path-to-json-file')
    sys.exit(1)

  if len(argv) != 2:
    logging.info('Argument number error. Usage: publisher.py <flags> '
                 'path-to-json-file')
    sys.exit(1)

  json_path = argv[1]