{ "info": { "author": "Adam Fast", "author_email": "adamfast@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "slowpoke is desiged to allow developers to require specific performance of themselves during test execution. I call this \"legislated performance.\"\n\nThis is good for a few reasons:\n- If you screw something up and take a single view from 100ms to 1500ms, you'll know about it very quickly.\n- If you have an SLA that requires your view to respond in a certain amount of time, you will want to make sure all of those views respond that quickly during testing.\n- Users like fast apps, and devs should too.\n\nThis is bad for a few reasons:\n- Computers are different. Need for Speed ran great on my IBM PS/2 Model 25 but was unplayable when I got a 486. If you set your standards for a lightly loaded 16-core Xeon box and regularly run tests on a Core 2 1.6, you're not going to have valid data. (note: it DOES log the hostname of the computer the tests were run on to give you a chance to sort that type of thing out.)\n- It doesn't take setUp / tearDown processing into account (maybe a good thing too?)\n NOTE: If you decorate setUp/tearDown then they will be timed / recorded\n\nIt's got plenty of moving pieces to install right now - I don't see any way to make it simpler, but it does exactly what I want.\n\nPYTHONPATH issues:\n- django-slowpoke needs to be on your PYTHONPATH or in the virtualenv so that slowpoke.* will resolve.\n- If you want to use the sample installation, django-slowpoke/sampleproject also needs to be on your PYTHONPATH/virtualenv so that sampleproject and testapp resolve.\n\nSettings:\n TIME_STANDARDS:\n A dict of what each type of test *should* take to execute. Times are in milliseconds. Defaults to\n {\n 'task': 1000,\n 'web_view': 300,\n }\n\nAdd 'slowpoke' to your INSTALLED_APPS.\n\nConfigure the database:\nDATABASES['slowpokelogs'] = {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'slowpokelogs',\n 'USER': '',\n 'PASSWORD': '',\n 'HOST': '',\n 'PORT': '',\n}\n\nand the database router, which will send traffic to the right place when it's related to slowpoke (technically, all the code should use the using= kwarg to make this unnecessary...but just in case):\nDATABASE_ROUTERS = ['slowpoke.router.SlowPokeDBRouter']\n\nand the test runner, which handles setup tasks and creates logs on the fly when you do a test suite run.\nTEST_RUNNER = 'slowpoke.runner.SlowPokeTestRunner'\n\nAnd lastly, you need to specify which tests should be timed with a decorator. This is because MOST tests in our suite may not test just one thing, or test it all the way through in a way the time means something. Your data will be better if you create new tests that take an action all the way through and time that.\n\nfrom django.test import TestCase\nfrom slowpoke.decorator import time_my_test\n\nclass DecoratorTests(TestCase):\n @time_my_test('web_view')\n def test_view_ok(self):\n time.sleep(0.2)\n self.assertEqual(True, True)\n\n @time_my_test('web_view')\n def test_view_slow(self):\n time.sleep(0.35)\n self.assertEqual(True, True)\n\nOne of these will meet the standards, one will not. (if you want to time setUp / tearDown they are decoratable as well, and will show which method they were run for.)\n\nIn your admin you'll see a model with each test run, and as inlines on that object each of the tests that was timed, how long it took and whether or not that was up to the defined baseline.\n\nNow that you're logging this data though there's a lot of potential - want to ensure that each iterative run doesn't add more than 10% to execution time? The runner could be modified to look at the last run, or an aggregate of last run times, and do comparisons. I don't have a big enough archive of data to figure out what's useful or not yet - but neither do you. If you have ideas, please let me know.\n\nBut what if we want to time ALL the tests?\nI've spent some time trying to find a way to make this happen - but because of the way things go all the way down to unittest, I can't find a good way to intercept, run and time a test at a time. If you've got an idea that will work, I'd love to hear it.\n\nOther batteries:\n- The test runner will advise you about various simple settings that might make your tests faster if it detects something.\n- The test runner will allow you to include apps in settings.AVOID_TESTS_FOR and make sure their tests do not run (i.e. django, debug_toolbar, anything you're unlikely to be editing and at risk of breaking). This only matches the first part of the namespace - 'django' is valid, 'django.contrib.gis' won't do anything.\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/adamfast/django-slowpoke", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "slowpoke", "package_url": "https://pypi.org/project/slowpoke/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/slowpoke/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/adamfast/django-slowpoke" }, "release_url": "https://pypi.org/project/slowpoke/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "A utility to track test execution over time.", "version": "1.0.1" }, "last_serial": 799710, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "8f59d7c04cf7316ea9c46183684d589c", "sha256": "2502c1c5f9908d696801b881e0db512c1fc98255d64360941458b26d93316bbe" }, "downloads": -1, "filename": "slowpoke-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8f59d7c04cf7316ea9c46183684d589c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6366, "upload_time": "2012-11-29T00:27:36", "url": "https://files.pythonhosted.org/packages/c5/d1/e6f69c93a1573a56dd6a482f71a8d2bcf74a124182fd7e608713685d1529/slowpoke-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8f59d7c04cf7316ea9c46183684d589c", "sha256": "2502c1c5f9908d696801b881e0db512c1fc98255d64360941458b26d93316bbe" }, "downloads": -1, "filename": "slowpoke-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8f59d7c04cf7316ea9c46183684d589c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6366, "upload_time": "2012-11-29T00:27:36", "url": "https://files.pythonhosted.org/packages/c5/d1/e6f69c93a1573a56dd6a482f71a8d2bcf74a124182fd7e608713685d1529/slowpoke-1.0.1.tar.gz" } ] }