OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import argparse | 6 import argparse |
7 import errno | 7 import errno |
8 import os | 8 import os |
9 import re | 9 import re |
10 import sys | 10 import sys |
11 import urllib | 11 import urllib |
12 import urllib2 | 12 import urllib2 |
13 | 13 |
14 # Where all the data lives. | 14 # Where all the data lives. |
15 ROOT_URL = "http://build.chromium.org/p/chromium.memory.fyi/builders" | 15 ROOT_URL = "http://build.chromium.org/p/chromium.memory.fyi/builders" |
16 | 16 |
17 # TODO(groby) - support multi-line search from the command line. Useful when | 17 # TODO(groby) - support multi-line search from the command line. Useful when |
18 # scanning for classes of failures, see below. | 18 # scanning for classes of failures, see below. |
19 SEARCH_STRING = """<p class=\"failure result\"> | 19 SEARCH_STRING = """<p class=\"failure result\"> |
20 Failed memory test: content | 20 Failed memory test: content |
21 </p>""" | 21 </p>""" |
22 | 22 |
23 # Location of the log cache. | 23 # Location of the log cache. |
24 CACHE_DIR = "buildlogs.tmp" | 24 CACHE_DIR = "buildlogs.tmp" |
25 | 25 |
26 # If we don't find anything after searching |CUTOFF| logs, we're probably done. | 26 # If we don't find anything after searching |CUTOFF| logs, we're probably done. |
27 CUTOFF = 100 | 27 CUTOFF = 200 |
28 | 28 |
29 def EnsurePath(path): | 29 def EnsurePath(path): |
30 """Makes sure |path| does exist, tries to create it if it doesn't.""" | 30 """Makes sure |path| does exist, tries to create it if it doesn't.""" |
31 try: | 31 try: |
32 os.makedirs(path) | 32 os.makedirs(path) |
33 except OSError as exception: | 33 except OSError as exception: |
34 if exception.errno != errno.EEXIST: | 34 if exception.errno != errno.EEXIST: |
35 raise | 35 raise |
36 | 36 |
37 | 37 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 print "Earliest occurrence in build %d" % min_build | 218 print "Earliest occurrence in build %d" % min_build |
219 print "Latest occurrence in build %d" % max(occurrences) | 219 print "Latest occurrence in build %d" % max(occurrences) |
220 print "Latest build: %d" % builder.LatestBuild() | 220 print "Latest build: %d" % builder.LatestBuild() |
221 print path | 221 print path |
222 print "%d total" % len(occurrences) | 222 print "%d total" % len(occurrences) |
223 | 223 |
224 | 224 |
225 if __name__ == "__main__": | 225 if __name__ == "__main__": |
226 sys.exit(main(sys.argv)) | 226 sys.exit(main(sys.argv)) |
227 | 227 |
OLD | NEW |