Created
July 31, 2019 11:53
-
-
Save agatsoh/b6b5636f8e1c929518eb97eee98f6cb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
def payment(): | |
return requests.post('http://localhost:5011/api/v1/payments/0xb0723f82B595De47920C9A1605b7dF754d8cDe5C/0xf1a500EA6B3afDcF98C8ff466dB68875003Bb686', | |
headers={ 'Content-Type': 'application/json', }, json={ 'amount': 1 }) | |
start = time.time() | |
for i in range(500): | |
resp = payment() | |
print('The payment number {} has the status code {}'.format(i, resp.status_code)) | |
if resp.status_code != 200: | |
print('The status code is not 200 hence breaking off count is {}'.format(i)) | |
break | |
end = time.time() | |
print('Time elapsed ', end - start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment