Skip to content

Commit

Permalink
json benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
Undo1 committed Jul 2, 2015
1 parent 35ecb09 commit ecf23d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bodyfetcher.py
Expand Up @@ -59,7 +59,11 @@ def make_api_call_for_site(self, site):
# wait to make sure API has/updates post data
time.sleep(60)
try:
jsonstart = time.time()
response = requests.get(url, timeout=20).json()
jsonend = time.time()
print "Fetch benchmark: "
print jsonend - jsonstart
except requests.exceptions.Timeout:
return # could add some retrying logic here, but eh.

Expand Down

0 comments on commit ecf23d4

Please sign in to comment.