| Index: tools/chrome_remote_control/examples/crc_perf_test.py
|
| diff --git a/tools/chrome_remote_control/examples/crc_perf_test.py b/tools/chrome_remote_control/examples/crc_perf_test.py
|
| deleted file mode 100755
|
| index fd76a3744ee90f93b23341df6c065d9f2d911901..0000000000000000000000000000000000000000
|
| --- a/tools/chrome_remote_control/examples/crc_perf_test.py
|
| +++ /dev/null
|
| @@ -1,43 +0,0 @@
|
| -#!/usr/bin/env python
|
| -# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| -# Use of this source code is governed by a BSD-style license that can be
|
| -# found in the LICENSE file.
|
| -import os
|
| -import sys
|
| -import time
|
| -
|
| -sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
| -
|
| -import chrome_remote_control
|
| -
|
| -def Main(args):
|
| - options = chrome_remote_control.BrowserOptions()
|
| - parser = options.CreateParser('crc_perf_test.py')
|
| - options, args = parser.parse_args(args)
|
| -
|
| - browser_to_create = chrome_remote_control.FindBrowser(options)
|
| - assert browser_to_create
|
| - with browser_to_create.Create() as b:
|
| - with b.ConnectToNthTab(0) as tab:
|
| -
|
| - # Measure round-trip-time for evaluate
|
| - times = []
|
| - for i in range(1000):
|
| - start = time.time()
|
| - tab.runtime.Evaluate('%i * 2' % i)
|
| - times.append(time.time() - start)
|
| - N = float(len(times))
|
| - avg = sum(times, 0.0) / N
|
| - squared_diffs = [(t - avg) * (t - avg) for t in times]
|
| - stdev = sum(squared_diffs, 0.0) / (N - 1)
|
| - times.sort()
|
| - percentile_75 = times[int(0.75 * N)]
|
| -
|
| - print "%s: avg=%f; stdev=%f; min=%f; 75th percentile = %f" % (
|
| - "Round trip time (seconds)",
|
| - avg, stdev, min(times), percentile_75)
|
| -
|
| - return 0
|
| -
|
| -if __name__ == '__main__':
|
| - sys.exit(Main(sys.argv[1:]))
|
|
|