Exemple #1
0
def main():
    logging.basicConfig(level=logging.INFO)
    devil_chromium.Initialize()

    parser = _CreateArgumentParser()
    args = parser.parse_args()
    OPTIONS.SetParsedArgs(args)

    if os.path.exists(args.output_filename):
        logging.error('Output file %s already exists.' % args.output_filename)
        sys.exit(1)

    device = prefetch_predictor_common.FindDevice(args.device)
    if device is None:
        logging.error('Could not find device: %s.', args.device)
        sys.exit(1)

    delays = [int(x) for x in args.prefetch_delays_ms.split(',')]

    with open(args.output_filename, 'w') as f:
        f.write(','.join(customtabs_benchmark.RESULT_FIELDS) + '\n')

    while True:
        delay = delays[random.randint(0, len(delays) - 1)]
        _RunOnce(device, args.database, args.url, delay, args.output_filename,
                 args.wpr_archive, args.network_condition)
        if args.once:
            return
def main():
    logging.basicConfig(level=logging.INFO)
    devil_chromium.Initialize()

    parser = _CreateArgumentParser()
    args = parser.parse_args()
    OPTIONS.SetParsedArgs(args)
    device = prefetch_predictor_common.FindDevice(args.device)
    if device is None:
        logging.error('Could not find device: %s.', args.device)
        sys.exit(1)

    _Setup(device, args.database)
    _Go(device, args.url, int(args.prefetch_delay_ms))
def main():
  devil_chromium.Initialize()
  logging.basicConfig(level=logging.INFO)

  parser = _CreateArgumentParser()
  args = parser.parse_args()
  OPTIONS.SetParsedArgs(args)

  device = prefetch_predictor_common.FindDevice(args.device)
  if device is None:
    logging.error('Could not find device: %s.', args.device)
    sys.exit(1)

  chrome_controller = prefetch_predictor_common.Setup(
      device, ['--speculative-resource-prefetching=learning'])
  _Go(chrome_controller, args.urls_filename, args.output_filename,
      int(args.url_repeat))
Exemple #4
0
def main():
  devil_chromium.Initialize()
  logging.basicConfig(level=logging.INFO)

  parser = _CreateArgumentParser()
  args = parser.parse_args()
  OPTIONS.SetParsedArgs(args)

  device = prefetch_predictor_common.FindDevice(args.device)
  if device is None:
    logging.error('Could not find device: %s.', args.device)
    sys.exit(1)

  chrome_controller = prefetch_predictor_common.Setup(device, _LEARNING_FLAGS)
  _GenerateDatabase(chrome_controller, args.urls_filename,
                    args.output_filename, int(args.url_repeat))
  _GenerateWprArchive(device, args.test_url, args.wpr_archive)