Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: dashboard/dashboard/benchmark_health_report.py

Issue 2706813003: Add new endpoint to get bug details as JSON. (Closed)
Patch Set: Actually link bugs Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | dashboard/dashboard/bug_details.py » ('j') | dashboard/dashboard/bug_details.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides the web interface for a report on benchmark alert health.""" 5 """Provides the web interface for a report on benchmark alert health."""
6 6
7 import datetime 7 import datetime
8 import json 8 import json
9 9
10 from dashboard import alerts 10 from dashboard import alerts
11 from dashboard import list_tests 11 from dashboard import list_tests
12 from dashboard import oauth2_decorator
12 from dashboard import update_test_suites 13 from dashboard import update_test_suites
13 from dashboard.common import request_handler 14 from dashboard.common import request_handler
14 from dashboard.common import utils 15 from dashboard.common import utils
15 from dashboard.models import anomaly 16 from dashboard.models import anomaly
16 17
17 18
18 class BenchmarkHealthReportHandler(request_handler.RequestHandler): 19 class BenchmarkHealthReportHandler(request_handler.RequestHandler):
19 20
21 @oauth2_decorator.DECORATOR.oauth_required
20 def get(self): 22 def get(self):
21 """Renders the UI for the group report page.""" 23 """Renders the UI for the group report page."""
22 self.RenderStaticHtml('benchmark_health_report.html') 24 self.RenderStaticHtml('benchmark_health_report.html')
23 25
24 def post(self): 26 def post(self):
25 """Returns data about the alerts for a benchmark. 27 """Returns data about the alerts for a benchmark.
26 28
27 Request parameters: 29 Request parameters:
28 master: If specified, the master to list benchmarks for. If no arguments 30 master: If specified, the master to list benchmarks for. If no arguments
29 are specified, benchmarks will be listed for chromium.perf. 31 are specified, benchmarks will be listed for chromium.perf.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 pattern, list_entities=True) 82 pattern, list_entities=True)
81 return monitored_tests[0].sheriff 83 return monitored_tests[0].sheriff
82 84
83 def _BenchmarkName(self, alert): 85 def _BenchmarkName(self, alert):
84 return utils.TestPath(alert.test).split('/')[2] 86 return utils.TestPath(alert.test).split('/')[2]
85 87
86 def _GetResponseValuesForMaster(self, master): 88 def _GetResponseValuesForMaster(self, master):
87 benchmarks = update_test_suites.FetchCachedTestSuites() 89 benchmarks = update_test_suites.FetchCachedTestSuites()
88 benchmarks = [b for b in benchmarks if master in benchmarks[b]['mas']] 90 benchmarks = [b for b in benchmarks if master in benchmarks[b]['mas']]
89 return {'benchmarks': sorted(benchmarks)} 91 return {'benchmarks': sorted(benchmarks)}
OLDNEW
« no previous file with comments | « no previous file | dashboard/dashboard/bug_details.py » ('j') | dashboard/dashboard/bug_details.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698