Add debug output to latency testing

This commit is contained in:
Matt Martz 2016-09-27 11:23:25 -05:00
parent b075152e3e
commit 9f44a72fdb
1 changed files with 3 additions and 0 deletions

View File

@ -891,6 +891,7 @@ class Speedtest(object):
cum = [] cum = []
url = os.path.dirname(server['url']) url = os.path.dirname(server['url'])
urlparts = urlparse('%s/latency.txt' % url) urlparts = urlparse('%s/latency.txt' % url)
printer('%s %s/latency.txt' % ('GET', url), debug=True)
for _ in range(0, 3): for _ in range(0, 3):
try: try:
if urlparts[0] == 'https': if urlparts[0] == 'https':
@ -903,6 +904,8 @@ class Speedtest(object):
r = h.getresponse() r = h.getresponse()
total = (timeit.default_timer() - start) total = (timeit.default_timer() - start)
except HTTP_ERRORS: except HTTP_ERRORS:
e = sys.exc_info()[1]
printer('%r' % e, debug=True)
cum.append(3600) cum.append(3600)
continue continue