Skip to content

Instantly share code, notes, and snippets.

@djipko
Created April 3, 2014 09:50
Show Gist options
  • Select an option

  • Save djipko/9951668 to your computer and use it in GitHub Desktop.

Select an option

Save djipko/9951668 to your computer and use it in GitHub Desktop.
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