Created
April 3, 2014 09:50
-
-
Save djipko/9951668 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 gc | |
| import os | |
| import requests | |
| import subprocess | |
| import sys | |
| class request_maker(object): | |
| def __init__(self): | |
| self.s = requests.Session() | |
| def make(self): | |
| self.s.request("GET", "http://www.google.com") | |
| def run_maker(): | |
| rm = request_maker() | |
| for i in xrange(10): | |
| rm.make() | |
| if __name__ == "__main__": | |
| if len(sys.argv) == 2 and sys.argv[1] == 'scope': | |
| rm = request_maker() | |
| for i in xrange(10): | |
| rm.make() | |
| else: | |
| run_maker() | |
| subprocess.call("lsof -p%d -a -iTCP" % (os.getpid(),), shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment