diff options
Diffstat (limited to 'buildscripts/collect_resource_info.py')
-rwxr-xr-x | buildscripts/collect_resource_info.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/buildscripts/collect_resource_info.py b/buildscripts/collect_resource_info.py index 43fb4930ab6..697179bcc8f 100755 --- a/buildscripts/collect_resource_info.py +++ b/buildscripts/collect_resource_info.py @@ -1,8 +1,8 @@ #!/usr/bin/env python """Collect system resource information on processes running in Evergreen on a given interval.""" -from __future__ import absolute_import -from __future__ import print_function + + from datetime import datetime import optparse @@ -24,13 +24,15 @@ def main(): """Main.""" usage = "usage: %prog [options]" parser = optparse.OptionParser(description=__doc__, usage=usage) - parser.add_option("-i", "--interval", dest="interval", default=5, type="int", - help="Collect system resource information every <interval> seconds. " - "Default is every 5 seconds.") - parser.add_option("-o", "--output-file", dest="outfile", default="-", - help="If '-', then the file is written to stdout." - " Any other value is treated as the output file name. By default," - " output is written to stdout.") + parser.add_option( + "-i", "--interval", dest="interval", default=5, type="int", + help="Collect system resource information every <interval> seconds. " + "Default is every 5 seconds.") + parser.add_option( + "-o", "--output-file", dest="outfile", default="-", + help="If '-', then the file is written to stdout." + " Any other value is treated as the output file name. By default," + " output is written to stdout.") (options, _) = parser.parse_args() @@ -40,8 +42,9 @@ def main(): # Requires the Evergreen agent to be running on port 2285. response = requests.get("http://localhost:2285/status") if response.status_code != requests.codes.ok: - print("Received a {} HTTP response: {}".format(response.status_code, - response.text), file=sys.stderr) + print( + "Received a {} HTTP response: {}".format(response.status_code, + response.text), file=sys.stderr) time.sleep(options.interval) continue |