Skip to content

Commit

Permalink
added a README with a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekziade committed Dec 11, 2012
1 parent 3bc4d25 commit b739584
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 1 deletion.
24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Simple HTTP Load tester
=======================

**I am a prototype**


::

$ pip install boom
$ boom http://localhost:80 -c 10 -n 10
Server Software: nginx/1.2.2
Starting the load [====================================================================================================] Done

-------- Results --------
Successful calls 100
Average 0.0263 s
Fastest 0.0126 s
Slowest 0.0307 s
Amplitude 0.0181 s
RPS 343
BSI Pretty good



79 changes: 79 additions & 0 deletions boom/_patch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import threading
from threading import (_active_limbo_lock, _limbo, _active, _sys, _trace_hook,
_profile_hook, _format_exc)


# see http://bugs.python.org/issue1596321
def _bootstrap_inner(self):
try:
self._set_ident()
self._Thread__started.set()
with _active_limbo_lock:
_active[self._Thread__ident] = self
del _limbo[self]

if _trace_hook:
_sys.settrace(_trace_hook)
if _profile_hook:
_sys.setprofile(_profile_hook)

try:
self.run()
except SystemExit:
pass
except:
if _sys:
_sys.stderr.write("Exception in thread %s:\n%s\n" %
(self.name, _format_exc()))
else:
exc_type, exc_value, exc_tb = self._exc_info()
try:
self._stderr.write(
"Exception in thread " + self.name + " (most likely "
"raised during interpreter shutdown):")

self._stderr.write("Traceback (most recent call last):")
while exc_tb:
self._stderr.write(
' File "%s", line %s, in %s' %
(exc_tb.tb_frame.f_code.co_filename,
exc_tb.tb_lineno,
exc_tb.tb_frame.f_code.co_name))

exc_tb = exc_tb.tb_next
self._stderr.write("%s: %s" % (exc_type, exc_value))
finally:
del exc_type, exc_value, exc_tb
finally:
pass
finally:
with _active_limbo_lock:
self._Thread__stop()
try:
del _active[self._Thread__ident]
except:
pass


def _delete(self):
try:
with _active_limbo_lock:
del _active[self._Thread__ident]
except KeyError:
if 'dummy_threading' not in _sys.modules:
raise


# http://bugs.python.org/issue14308
def _stop(self):
# DummyThreads delete self.__block, but they have no waiters to
# notify anyway (join() is forbidden on them).
if not hasattr(self, '_Thread__block'):
return
self._Thread__stop_old()


threading.Thread._Thread__bootstrap_inner = _bootstrap_inner
threading.Thread._Thread__delete = _delete
threading.Thread._Thread__stop_old = threading.Thread._Thread__stop
threading.Thread._Thread__stop = _stop
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@


setup(name='boom',
version='0.1',
version='0.1.1',
url='https://github.com/tarekziade/boom',
packages=find_packages(),
description=("Simple HTTP Load tester"),
author="Tarek Ziade",
Expand Down

0 comments on commit b739584

Please sign in to comment.