EagleEye perf graphs now support autotests whose names have changed.

The JSON file specifying which performance graphs to plot has now been
restructured: the file is now a list of objects representing each test
to plot.  A test has a name, an optional list of "old_test_names" (in
case the name of the test has changed over time), and a list of graphs
to display that are associated with the test.

The scripts to extract perf values and generate perf graphs have been
adjusted to account for the changed JSON file format.  In the event that
a test is associated with one or more "old_test_names", then any perf values
from an old test name are processed and treated as if they are simply
associated with the new test name.  So a test that used to be called "X",
but is now called "Y", will show up in the graphs as test "Y", but will
implicitly include all results from both "X" and "Y" taken together.

BUG=chromium-os:38150
TEST=Verified locally that autotest desktopui_PyAutoPerf (which used to
be called desktopui_PyAutoPerfTests in the autotest database) shows up
properly in the perf graphs and contains the perf results from both
the old and new autotest names.

Change-Id: I5b41e176b5fa72f0156984b067cd14dc56f3d73b
Reviewed-on: https://gerrit.chromium.org/gerrit/43238
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Dennis Jeffrey <dennisjeffrey@chromium.org>
Tested-by: Dennis Jeffrey <dennisjeffrey@chromium.org>
diff --git a/frontend/perf-dashboard/extract_perf.py b/frontend/perf-dashboard/extract_perf.py
index 9cd66a1..6f69a1e 100644
--- a/frontend/perf-dashboard/extract_perf.py
+++ b/frontend/perf-dashboard/extract_perf.py
@@ -150,6 +150,9 @@
         # TODO(dennisjeffrey): Simplify the below code once the following bug
         # is addressed to standardize the platform names: crosbug.com/38521.
         match = re.search('(\w+)-r', job_name)
+        if not match:
+            unexpected_job_names.add(job_name)
+            continue
         # Only process jobs for known platforms.
         platform = match.group(1) if match.group(1) in _PLATFORMS else None
         if platform:
@@ -230,7 +233,11 @@
                   oldest_db_lookup_date)
 
     # Get unique test names.
-    test_names = set([c['test_name'] for c in charts])
+    test_names = set()
+    for c in charts:
+        test_names.add(c['test_name'])
+        if 'old_test_names' in c:
+            test_names |= set(c['old_test_names'])
 
     # Get list of already-completed job IDs so we don't re-fetch their data.
     completed_ids = set()