Adds dashboard link for one-line plot on each alert item.

BUG=skia:2523
NOTRY=true
R=kelvinly@google.com
TBR=rmistry@google.com

Author: bensong@google.com

Review URL: https://codereview.chromium.org/280663002

git-svn-id: http://skia.googlecode.com/svn/trunk@14713 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/check_bench_regressions.py b/bench/check_bench_regressions.py
index 86ead54..ea91464 100644
--- a/bench/check_bench_regressions.py
+++ b/bench/check_bench_regressions.py
@@ -28,6 +28,9 @@
 SLOWER = 0
 FASTER = 1
 
+# URL prefix for the bench dashboard page. Showing recent 15 days of data.
+DASHBOARD_URL_PREFIX = 'http://go/skpdash/#15'
+
 def usage():
     """Prints simple usage information."""
 
@@ -147,6 +150,9 @@
     for line in lines:
         line_str = str(line)
         line_str = line_str[ : line_str.find('_{')]
+        # Extracts bench and config from line_str, which is in the format
+        # <bench-picture-name>.skp_<config>_
+        bench, config = line_str.strip('_').split('.skp_')
         bench_platform_key = line_str + ',' + key_suffix
         if bench_platform_key not in expectations:
             continue
@@ -157,6 +163,8 @@
             exception = 'Bench %s out of range [%s, %s] (%s vs %s, %s%%).' % (
                 bench_platform_key, this_min, this_max, this_bench_value,
                 this_expected, (off_ratio - 1) * 100)
+            exception += '\n' + '~'.join([
+                DASHBOARD_URL_PREFIX, bench, platform, config])
             if off_ratio > 1:  # Bench is slower.
                 exceptions[SLOWER].setdefault(off_ratio, []).append(exception)
             else:
diff --git a/tools/tests/benchalerts/Perf-Android-Nexus7-Tegra3-Arm7-Release/output-expected/stderr b/tools/tests/benchalerts/Perf-Android-Nexus7-Tegra3-Arm7-Release/output-expected/stderr
index 1edf4ba..5c9204d 100644
--- a/tools/tests/benchalerts/Perf-Android-Nexus7-Tegra3-Arm7-Release/output-expected/stderr
+++ b/tools/tests/benchalerts/Perf-Android-Nexus7-Tegra3-Arm7-Release/output-expected/stderr
@@ -2,8 +2,11 @@
 
 2 benches got slower (sorted by % difference):
 Bench desk_blogger.skp_record_,Perf-Android-Nexus7-Tegra3-Arm7-Release-25th out of range [0.4, 0.6] (1.794 vs 0.5, 258.8%).
+http://go/skpdash/#15~desk_blogger~Perf-Android-Nexus7-Tegra3-Arm7-Release~record
 Bench desk_amazon.skp_record_,Perf-Android-Nexus7-Tegra3-Arm7-Release-25th out of range [-1.0, 1.2] (1.213 vs 1.1, 10.2727272727%).
+http://go/skpdash/#15~desk_amazon~Perf-Android-Nexus7-Tegra3-Arm7-Release~record
 
 1 benches got faster (sorted by % difference):
 Bench desk_baidu.skp_record_,Perf-Android-Nexus7-Tegra3-Arm7-Release-25th out of range [0.9, 1.0] (0.83 vs 0.939, -11.6080937167%).
+http://go/skpdash/#15~desk_baidu~Perf-Android-Nexus7-Tegra3-Arm7-Release~record