{ "info": { "author": "Oliver Bristow", "author_email": "github+pypi@oliverbristow.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing :: Traffic Generation" ], "description": "Rush\n====\n\nThis python module is for making simple tools that rush a resource, such\nas an API endpoint or web UI. This runs with both Python 2.6+ or 3.0+.\n\nThis was originally created to test the throttling of authentication\nattempts. It is quite basic, but was enough to get good results from a\nDjango based web app. I imagine that this is good enough to indicate if\nrate limiting is reasonably implemented on faster systems (more likely\nto come down to network?).\n\nExample\n-------\n\nThis example attempts to connect to an API endpoint which will throttle\nafter 10 requests:\n\n.. code:: python\n\n try:\n # Python 2\n from xmlrpclib import ServerProxy, Fault\n except ImportError:\n # Python 3\n from xmlrpc.client import ServerProxy, Fault\n\n from rush import Rusher\n\n\n def api_auth_tester(index, thread_count):\n \"\"\"\n Rush the API with invalid authentication attempts.\n \"\"\"\n # prepare the worker\n proxy = ServerProxy('https://badname:supersecretpassword@api.memset.com/v1/xmlrpc/')\n yield # yield to indicate that the worker is ready to rush\n # rush\n try:\n proxy.server.list()\n except Fault as error:\n # yield a string indicating the result\n if error.faultCode == 4: # bad username/pass\n yield 'attempted'\n elif error.faultCode == 12: # throttled\n yield 'throttled'\n\n print(\"API rate limiting test:\")\n # the API will throttle after 10 requests, so make 9 requests first, then rush two calls\n rusher = Rusher(api_auth_tester, 9)\n # preform the first 9 requests so the next request should set a throttling indicator\n duration, results = rusher.rush_and_report()\n # change the number of threads we want to make\n rusher.thread_count = 2\n # only one call should not be throttled\n rusher.rush_and_report()\n\nThis will produce output like the following:\n\n::\n\n API rate limiting test:\n 9 threads completed in .747115, results:\n attempted: 9\n 2 threads completed in .127208, results:\n attempted: 1\n throttled: 1", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Code0x58/python-rush/", "keywords": "rush resource", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-rush", "package_url": "https://pypi.org/project/python-rush/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-rush/", "project_urls": { "Homepage": "https://github.com/Code0x58/python-rush/" }, "release_url": "https://pypi.org/project/python-rush/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Create workers, wait for them to be ready, then run them all at once", "version": "1.0.0" }, "last_serial": 2805771, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0bc3f44a19bdf1a83a6cbf6efa48c88a", "sha256": "2e10da3f9f07256ff29c056f0f8f2f2a8b278eb6aa9f081c89aef4d334c79830" }, "downloads": -1, "filename": "python_rush-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0bc3f44a19bdf1a83a6cbf6efa48c88a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6686, "upload_time": "2017-04-15T16:18:20", "url": "https://files.pythonhosted.org/packages/7f/14/d025f3ac52a0b46ed5eb33b69ba8d1347b4d11f449eda1ceca79cd4053f6/python_rush-1.0.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0bc3f44a19bdf1a83a6cbf6efa48c88a", "sha256": "2e10da3f9f07256ff29c056f0f8f2f2a8b278eb6aa9f081c89aef4d334c79830" }, "downloads": -1, "filename": "python_rush-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0bc3f44a19bdf1a83a6cbf6efa48c88a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6686, "upload_time": "2017-04-15T16:18:20", "url": "https://files.pythonhosted.org/packages/7f/14/d025f3ac52a0b46ed5eb33b69ba8d1347b4d11f449eda1ceca79cd4053f6/python_rush-1.0.0-py2.py3-none-any.whl" } ] }