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

Side by Side Diff: tools/gardening/lib/src/bot.dart

Issue 3000953002: Use Bot in compare_failures (Closed)
Patch Set: Created 3 years, 4 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 | « tools/gardening/bin/compare_failures.dart ('k') | tools/gardening/lib/src/client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'buildbot_data.dart'; 7 import 'buildbot_data.dart';
8 import 'buildbot_structures.dart'; 8 import 'buildbot_structures.dart';
9 import 'client.dart'; 9 import 'client.dart';
10 import 'util.dart'; 10 import 'util.dart';
11 11
12 class Bot { 12 class Bot {
13 final bool usesLogdog;
14 final BuildbotClient _client; 13 final BuildbotClient _client;
15 14
16 /// Instantiates a Bot. 15 /// Instantiates a Bot.
17 /// 16 ///
18 /// Bots must be [close]d when they aren't needed anymore. 17 /// Bots must be [close]d when they aren't needed anymore.
19 Bot({bool logdog = false}) 18 Bot({bool logdog = false})
20 : usesLogdog = logdog, 19 : this.internal(
21 _client = 20 logdog ? new LogdogBuildbotClient() : new HttpBuildbotClient());
22 logdog ? new LogdogBuildbotClient() : new HttpBuildbotClient(); 21
22 Bot.internal(this._client);
23 23
24 int get mostRecentBuildNumber => _client.mostRecentBuildNumber; 24 int get mostRecentBuildNumber => _client.mostRecentBuildNumber;
25 25
26 /// Reads the build result of [buildUri] and the [previousCount] earlier 26 /// Reads the build result of [buildUri] and the [previousCount] earlier
27 /// builds. 27 /// builds.
28 Future<List<BuildResult>> readHistoricResults(BuildUri buildUri, 28 Future<List<BuildResult>> readHistoricResults(BuildUri buildUri,
29 {int previousCount = 0}) { 29 {int previousCount = 0}) {
30 log("Fetching $buildUri and $previousCount previous builds in parallel"); 30 log("Fetching $buildUri and $previousCount previous builds in parallel");
31 var uris = [buildUri]; 31 var uris = [buildUri];
32 for (int i = 0; i < previousCount; i++) { 32 for (int i = 0; i < previousCount; i++) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 List<BuildUri> result = []; 70 List<BuildUri> result = [];
71 for (BuildGroup group in buildGroups) { 71 for (BuildGroup group in buildGroups) {
72 result.addAll(group.createUris(mostRecentBuildNumber)); 72 result.addAll(group.createUris(mostRecentBuildNumber));
73 } 73 }
74 return result; 74 return result;
75 } 75 }
76 76
77 /// Closes the bot. 77 /// Closes the bot.
78 void close() => _client.close(); 78 void close() => _client.close();
79 } 79 }
OLDNEW
« no previous file with comments | « tools/gardening/bin/compare_failures.dart ('k') | tools/gardening/lib/src/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698