OLD | NEW |
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 oauth2_decorator |
11 from dashboard import update_test_suites | 12 from dashboard import update_test_suites |
12 from dashboard.common import request_handler | 13 from dashboard.common import request_handler |
13 from dashboard.models import anomaly | 14 from dashboard.models import anomaly |
14 | 15 |
15 | 16 |
16 class BenchmarkHealthReportHandler(request_handler.RequestHandler): | 17 class BenchmarkHealthReportHandler(request_handler.RequestHandler): |
17 | 18 |
| 19 @oauth2_decorator.DECORATOR.oauth_required |
18 def get(self): | 20 def get(self): |
19 """Renders the UI for the group report page.""" | 21 """Renders the UI for the group report page.""" |
20 self.RenderStaticHtml('benchmark_health_report.html') | 22 self.RenderStaticHtml('benchmark_health_report.html') |
21 | 23 |
22 def post(self): | 24 def post(self): |
23 """Returns data about the alerts for a benchmark. | 25 """Returns data about the alerts for a benchmark. |
24 | 26 |
25 Request parameters: | 27 Request parameters: |
26 master: If specified, the master to list benchmarks for. If no arguments | 28 master: If specified, the master to list benchmarks for. If no arguments |
27 are specified, benchmarks will be listed for chromium.perf. | 29 are specified, benchmarks will be listed for chromium.perf. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 values['monitored'] = True | 65 values['monitored'] = True |
64 else: | 66 else: |
65 values['monitored'] = False | 67 values['monitored'] = False |
66 values['bots'] = benchmarks[benchmark]['mas'][master].keys() | 68 values['bots'] = benchmarks[benchmark]['mas'][master].keys() |
67 return values | 69 return values |
68 | 70 |
69 def _GetResponseValuesForMaster(self, master): | 71 def _GetResponseValuesForMaster(self, master): |
70 benchmarks = update_test_suites.FetchCachedTestSuites() | 72 benchmarks = update_test_suites.FetchCachedTestSuites() |
71 benchmarks = [b for b in benchmarks if master in benchmarks[b]['mas']] | 73 benchmarks = [b for b in benchmarks if master in benchmarks[b]['mas']] |
72 return {'benchmarks': sorted(benchmarks)} | 74 return {'benchmarks': sorted(benchmarks)} |
OLD | NEW |