Manual Setup

This page describes how to set up Chrome Endure on your local machine so that you can run Chrome Endure tests and view the resulting performance graphs locally.

If you don't care about seeing local performance graphs of the results, you can skip Step 2 entirely, and in Step 3, simply refrain from specifying the LOCAL_PERF_DIR environment variable when running the test.


Step 1: Set up Chromium and pyauto on your local machine, and verify you can run a basic performance test.

Follow the instructions for setting up pyauto.  You'll have two choices:
  1. Check out and build Chromium and pyauto yourself.
  2. Run pyauto using prebuilt Chromium/pyauto binaries.
Either one will work. Once you've set things up on your local machine, try to run a basic performance test. From the src/chrome/test/functional directory of your local checkout, execute this command:

$> python perf.py perf.TabPerfTest.testNewTab

This test runs multiple trials and measures the average time it takes to open up a tab to Chromium's new tab page. You should see an "OK" printed at the end of the test output, indicating that the test passed.


Step 2: Obtain the Chrome graphing files so that you can see local graphs of test results

Chrome Endure currently relies on a modified version of the Chromium perf graphing files. The graphing files are located here:

http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/functional/perf/endure_graphs/

and that should already be in your local checkout after setting up pyauto in Step 1 above. The graphs must be viewed over HTTP, so copy the graph UI code into a directory that can be served via HTTP. We'll assume the graphing code exists in the following directory:

/home/$USER/www/chrome_graphs

Once you've copied the graph files into your HTTP directory, recursively change the permissions of the files in that directory if needed. For example:

/home/$USER/www> chmod -R 755 chrome_graphs

From here on out, you should be able to access the local graphs by navigating to that directory via HTTP in a browser. For example::

http://localhost/chrome_graphs

Note that if you haven't run any tests yet, there will be no perf data there and you'll see a "Not Found" error for a missing file. That's to be expected.


Step 3: Run a Chrome Endure test and see the resulting graphs

We'll run a Chrome Endure test for Gmail, which iteratively starts composing a message, then deletes it before sending. Periodically, performance/memory statistics are sampled. We can control the test length, as well as the sampling rate, through environment variables named TEST_LENGTH and PERF_STATS_INTERVAL, respectively (both in seconds). Additionally, to see local graphs, we have to specify the directory into which we extracted the local graphing files in Step 2 above; this is done through an environment variable named LOCAL_PERF_DIR.

The test is a pyauto test named perf_endure.ChromeEndureGmailTest.testGmailComposeDiscard, and it is run just like any other pyauto test, with the exception that we also have to specify environment variables to the test. Let's assume that the local graph files are extracted into the directory listed in Step 2 above, and we want to run the test for 3 minutes, sampling performance stats every 20 seconds. In this case, we can invoke the test from the src/chrome/test/functional directory of the local Chromium checkout as follows:

$> TEST_LENGTH=180 PERF_STATS_INTERVAL=20 LOCAL_PERF_DIR=/home/$USER/www/chrome_graphs python perf_endure.py perf_endure.ChromeEndureGmailTest.testGmailComposeDiscard

When the test is running, as each performance/memory sample is taken, the results are immediately outputted to the local graph directory, so you should be able to refresh your graph URL to see the most recent results, even though the test may still be running.
Comments