{ "info": { "author": "Colin Howe", "author_email": "colin@colinhowe.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "==============\nDjango Sampler\n==============\n\nAuthor: Colin Howe (@colinhowe)\n\nLicense: Apache 2.0\n\nAbout\n=====\n\nDjango Sampler allows you to sample a percentage of your queries (SQL, Mongo,\netc) and view the ones that are taking up the most time. The queries are grouped\ntogether by where they originated from in your code.\n\nInstallation\n============\n\nInstall::\n\n pip install git+git://github.com/colinhowe/djangosampler.git#djangosampler\n\nor download and run ::\n\n python setup.py install\n\nConfigure:\n * Add ``djangosampler`` to your INSTALLED_APPS\n * Add the tables (``manage.py syncdb`` or ``manage.py migrate`` if you use South)\n * Add the views::\n\n urlpatterns += patterns('',\n (r'^sampler/', include('djangosampler.urls')),\n )\n\n * Set ``DJANGO_SAMPLER_FREQ`` to a value between 0 and 1\n * Set ``DJANGO_SAMPLER_PLUGINS`` to a list of plugins. For just sampling SQL a \n sensible default is::\n \n DJANGO_SAMPLER_PLUGINS = (\n 'djangosampler.plugins.sql.Sql',\n # Plugins are applied in the same order as this list\n )\n\n There are several plugins available and it is worthwhile reading through\n them to get the most use out of this tool.\n * If you are using cost based sampling then set ``DJANGO_SAMPLER_BASE_TIME`` to\n the expected duration of a normal query in seconds. By default this is set\n to 5ms.\n\n\nViewing Results\n===============\n\nAfter letting the sampler run for a while you will be able to view queries\n(grouped by their origin) at the URL you configured.\n\nConfiguration\n=============\n\nDJANGO_SAMPLER_PLUGINS\n~~~~~~~~~~~~~~~~~~~~~~\n\nDjango Sampler has a plugin architecture to allow you to control how\nmuch data you want to be collected.\n\nIn your settings.py add the following::\n\n DJANGO_SAMPLER_PLUGINS = (\n 'djangosampler.plugins.sql.Sql',\n # Plugins are applied in the same order as this list\n )\n\nThe example above will add the SQL plugin.\n\nAvailable plugins and their settings are described in the Plugins section below.\n\nDJANGO_SAMPLER_FREQ\n~~~~~~~~~~~~~~~~~~~\n\n``DJANGO_SAMPLER_FREQ`` configures the percentage of queries that will be recorded. \nIt should be between 0.0 and 1.0.\n\nIf this is not set then no plugins will be installed and your code will run as \nnormal.\n\nDJANGO_SAMPLER_USE_COST\n~~~~~~~~~~~~~~~~~~~~~~~\n\n``DJANGO_SAMPLER_USE_COST`` will enable cost-based sampling. This causes queries \nthat run for a long time to be sampled more often than short queries. \n\nThe chance that a query is sampled is multiplied by the total time the query\ntakes. If a query takes 2 seconds then it will be twice as likely to be sampled\nas a query that takes 1 second.\n\nThe cost for a query is adjusted to account for this as follows::\n\n cost = max(1.0, time * DJANGO_SAMPLER_FREQ) / DJANGO_SAMPLER_FREQ\n\nPlugins\n=======\n\nA list of available plugins follows. You can write your own plugin and this is \ndescribed in the section 'Writing Your Own Plugins'.\n\nDjango SQL\n~~~~~~~~~~\n\nPlugin class: ``djangosampler.plugins.sql.Sql``\n\nThe SQL sampler plugin will sample a percentage of SQL queries that occur in\nyour application. The samples will be grouped by query and stack traces will be\nrecorded to find where the queries are originating.\n\nDjango Requests\n~~~~~~~~~~~~~~~\n\nPlugin class: ``djangosampler.plugins.request.Request``\n\nThe request plugin installs a Middleware that will sample the time taken by\nrequests.\n\nSample any code\n~~~~~~~~~~~~~~~\n\nThis is not strictly a plugin. This is a context manager that will allow you\nto mark blocks of code and sample how long the blocks take to run. E.g.::\n\n from djangosampler.sampler import sampling\n\n with sampling('my_code', 'some_fn'):\n do_something_slow()\n\nCelery\n~~~~~~\n\nPlugin class: ``djangosampler.plugins.celery_task.Celery``\n\nThe Celery plugin uses Celery's signals to sample the time taken to execute\ntasks.\n\nMongoDB\n~~~~~~~\n\nPlugin class: ``djangosampler.plugins.mongo.Mongo``\n\nThe MongoDB plugin will sample a percentage of Mongo commands (queries,\ninserts, etc) that occur in your application. The samples will be grouped by\ncommand and stack traces will be recorded to find where the queries are \noriginating.\n\n\nWriting Your Own Plugins\n========================\n\nTODO. For now, look in the plugins folder and copy :)\n\nFeedback\n========\n\nFeedback is always welcome! Github or twitter (@colinhowe) are the best places\nto reach me.", "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/colinhowe/djangosampler", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "djangosampler", "package_url": "https://pypi.org/project/djangosampler/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/djangosampler/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/colinhowe/djangosampler" }, "release_url": "https://pypi.org/project/djangosampler/0.10.0/", "requires_dist": null, "requires_python": null, "summary": "Samples a percentage of SQL queries and groups them together for easy viewing", "version": "0.10.0" }, "last_serial": 2170841, "releases": { "0.10.0": [ { "comment_text": "built for Linux-3.2.0-37-generic-x86_64-with-glibc2.7", "digests": { "md5": "f83a2b10614e97d7e01e5350470eacb3", "sha256": "88d75fca616b8bd12660e4366e39e9ba6940650e37f7e290429346883cbd4201" }, "downloads": -1, "filename": "djangosampler-0.10.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "f83a2b10614e97d7e01e5350470eacb3", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 26003, "upload_time": "2015-11-17T10:21:31", "url": "https://files.pythonhosted.org/packages/cd/c0/16c3c29d5304c9f0611f79a32f5584e4d73cc39c609cb428a8c4722fae7e/djangosampler-0.10.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "f18b3b821f5b1690f425e071373425e1", "sha256": "59988208af850b915ff01071e2e81945e77d9ff3aaab681aa092daff9a328729" }, "downloads": -1, "filename": "djangosampler-0.10.0.tar.gz", "has_sig": false, "md5_digest": "f18b3b821f5b1690f425e071373425e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13130, "upload_time": "2015-11-17T10:21:02", "url": "https://files.pythonhosted.org/packages/b5/ff/672cef9a570977d49fb8a170970cf7905028b61a2806788d3d9454746ccb/djangosampler-0.10.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "808d04919ef6bd283204bf66065c9247", "sha256": "13201f36658da7e0f0103b660c0e0a7411454d6b6921130f3620b71149f7345a" }, "downloads": -1, "filename": "djangosampler-0.6.0.tar.gz", "has_sig": false, "md5_digest": "808d04919ef6bd283204bf66065c9247", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13073, "upload_time": "2012-04-01T11:13:20", "url": "https://files.pythonhosted.org/packages/93/74/0c6833183fc7df662ca9458482522454b5e88906cb8029cfdb15215d2a14/djangosampler-0.6.0.tar.gz" } ], "0.6.10": [ { "comment_text": "built for Linux-3.13.0-71-generic-x86_64-with-glibc2.4", "digests": { "md5": "37de9187c5e6e4a054050eeef6951a56", "sha256": "d0a0c9db8b6f40287b7cfb2f60ffd79e358a0f4b39179a15974ddc7b414f99b2" }, "downloads": -1, "filename": "djangosampler-0.6.10.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "37de9187c5e6e4a054050eeef6951a56", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 26708, "upload_time": "2016-06-16T08:45:58", "url": "https://files.pythonhosted.org/packages/29/6a/95da5164892ecb11bad50993e03398d0121f690552b1ed3c498c645dfe31/djangosampler-0.6.10.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "5c0c3b963f6b5c1438b43613120d1bf5", "sha256": "040dbb0049fbb0530a67b7df13eb90868b17227c9b34b79f37dcac7743067611" }, "downloads": -1, "filename": "djangosampler-0.6.10.tar.gz", "has_sig": false, "md5_digest": "5c0c3b963f6b5c1438b43613120d1bf5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13328, "upload_time": "2016-06-16T08:45:54", "url": "https://files.pythonhosted.org/packages/c9/9a/4cd40266f936423a41686367c84f214e4d8539cf6d1c1e10f612a3dd5198/djangosampler-0.6.10.tar.gz" } ], "0.6.12": [ { "comment_text": "built for Linux-3.13.0-71-generic-x86_64-with-glibc2.4", "digests": { "md5": "7f8a6f76cfb313154f8d39b3c86fcc89", "sha256": "990228f7c0bac04fbc456e9f445a2c02fe9b8390937aa8f3689b786d3ab6d5b8" }, "downloads": -1, "filename": "djangosampler-0.6.12.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "7f8a6f76cfb313154f8d39b3c86fcc89", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 27031, "upload_time": "2016-06-16T08:57:51", "url": "https://files.pythonhosted.org/packages/a6/3d/11c1974a4c66b4620aeae39d3a0a287648ce89952b09175b75056e2392a0/djangosampler-0.6.12.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "d1a9d42035d36b7cfd244c62049ef157", "sha256": "f995d75dc2ff6c5756e4aa2d4b7b0f348fda1544ad1ee2f57052419492bda943" }, "downloads": -1, "filename": "djangosampler-0.6.12.tar.gz", "has_sig": false, "md5_digest": "d1a9d42035d36b7cfd244c62049ef157", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13419, "upload_time": "2016-06-16T08:57:46", "url": "https://files.pythonhosted.org/packages/bc/ae/12f590da49ecd88dc08fd7a5aa307079e4eb4de90d2d52aba44376bf771a/djangosampler-0.6.12.tar.gz" } ], "0.6.13": [ { "comment_text": "built for Linux-3.13.0-71-generic-x86_64-with-glibc2.4", "digests": { "md5": "ca3a3b3012218ab5689257548ce3ef1e", "sha256": "7b0caa928c31c6b53f5c1b134f22cd632872b9358e2691f26b25fb9302b4474a" }, "downloads": -1, "filename": "djangosampler-0.6.13.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "ca3a3b3012218ab5689257548ce3ef1e", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 26645, "upload_time": "2016-06-16T09:54:33", "url": "https://files.pythonhosted.org/packages/e6/21/44a865e4c4e66ed51f7487a67e4a75bb1af5d7bbd4ea1c5e34acf5be9918/djangosampler-0.6.13.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "58ad7a2626344b787b23c277c4f02bad", "sha256": "1e19f3ca328a3d0c38c33df639348b5e0dbce0cf7adc44b769a9a9e6c5f283e6" }, "downloads": -1, "filename": "djangosampler-0.6.13.tar.gz", "has_sig": false, "md5_digest": "58ad7a2626344b787b23c277c4f02bad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13417, "upload_time": "2016-06-16T09:54:29", "url": "https://files.pythonhosted.org/packages/d6/53/454913f1f558d12524161718e99b60c27e0deae6311e6bc28dedd5d59490/djangosampler-0.6.13.tar.gz" } ], "0.6.14": [ { "comment_text": "built for Linux-3.13.0-71-generic-x86_64-with-glibc2.4", "digests": { "md5": "c86f42331f0ea5f479fa38f3587c379f", "sha256": "d1201be8ebc2d76ce488837a5d4e369c3c3f50c3a1e95910ca70f50b58782201" }, "downloads": -1, "filename": "djangosampler-0.6.14.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "c86f42331f0ea5f479fa38f3587c379f", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 27058, "upload_time": "2016-06-16T13:26:44", "url": "https://files.pythonhosted.org/packages/50/bd/bf117d6a357e719969b7fdd61233653b68f5594ad9ade195efcd7d35df68/djangosampler-0.6.14.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "7004c2792b047f7960bc2b247759ffc9", "sha256": "3252323f6b549aae961e446f22a366aba4ee013e8024d33ee672b25e598f7484" }, "downloads": -1, "filename": "djangosampler-0.6.14.tar.gz", "has_sig": false, "md5_digest": "7004c2792b047f7960bc2b247759ffc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13418, "upload_time": "2016-06-16T13:26:39", "url": "https://files.pythonhosted.org/packages/22/79/5b46d9bd3f8fed1efc3acf751cb80d4019d7e85dd566057e8e7968d13e53/djangosampler-0.6.14.tar.gz" } ], "0.6.8": [ { "comment_text": "", "digests": { "md5": "90893d225b70425ab4bfe1b7ebc2f31c", "sha256": "ea0fed05b20f283f99e2c57d7758d79dd8fe1bc313ab750452b9b7b8c66f8ba2" }, "downloads": -1, "filename": "djangosampler-0.6.8.tar.gz", "has_sig": false, "md5_digest": "90893d225b70425ab4bfe1b7ebc2f31c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13128, "upload_time": "2014-10-16T09:42:51", "url": "https://files.pythonhosted.org/packages/fc/90/d2b341dec3ac40f5d4a546c92b7ac580922afebab67f145fd446475b1465/djangosampler-0.6.8.tar.gz" } ], "0.6.9": [ { "comment_text": "built for Linux-3.2.0-37-generic-x86_64-with-glibc2.7", "digests": { "md5": "feee76ab14d0a61091ac11f9d7ed68b7", "sha256": "acda4a6e5721d6c2cf8b6f9220a35c27ecd7eb28ced1e953758ecee558967297" }, "downloads": -1, "filename": "djangosampler-0.6.9.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "feee76ab14d0a61091ac11f9d7ed68b7", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 25920, "upload_time": "2015-11-17T10:29:13", "url": "https://files.pythonhosted.org/packages/ec/74/ecc6bc96e9c05c81cba09963957f097228c1e699e50964ff584aa754dc39/djangosampler-0.6.9.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "65109807e90f68bf536d8a7d00ac73d8", "sha256": "0e823d0fe6c1a9f669b1fa68e8848e827b11eb2aa0e751dc3251a9957b9b05d3" }, "downloads": -1, "filename": "djangosampler-0.6.9.tar.gz", "has_sig": false, "md5_digest": "65109807e90f68bf536d8a7d00ac73d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13105, "upload_time": "2015-11-17T10:28:58", "url": "https://files.pythonhosted.org/packages/8a/ef/3210c7ac9c3e20fdae572f938a47e9d7195f719d1e37a0dd3fa3fd20dfea/djangosampler-0.6.9.tar.gz" } ], "0.7.0": [ { "comment_text": "built for Linux-3.2.0-37-generic-x86_64-with-glibc2.7", "digests": { "md5": "c097a0ce27f2f002e658567067e2b204", "sha256": "7e3454cbab5a507cb53f7eddee007bcaad33902bfc7b422191c10d263462aafb" }, "downloads": -1, "filename": "djangosampler-0.7.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "c097a0ce27f2f002e658567067e2b204", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 25859, "upload_time": "2015-08-11T10:06:12", "url": "https://files.pythonhosted.org/packages/65/d7/1195a64c17e6eec7efc254120a1b1946594a385363f90697b87951e459ab/djangosampler-0.7.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "ab3433752cc16cab5e74f8a24f9b2442", "sha256": "a3b469428470f15c6e36e4b1e2f121f336225dd6ce43e9320ce98c3db8623d2e" }, "downloads": -1, "filename": "djangosampler-0.7.0.tar.gz", "has_sig": false, "md5_digest": "ab3433752cc16cab5e74f8a24f9b2442", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13118, "upload_time": "2015-08-11T10:06:09", "url": "https://files.pythonhosted.org/packages/26/b6/da10e00a5f73b952e4cafe0e0cdd8b40f0c404de66733951768850812f16/djangosampler-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "built for Linux-3.2.0-37-generic-x86_64-with-glibc2.7", "digests": { "md5": "fdceb18b07d3db9588c7b6922785fdcc", "sha256": "651545f0d8abc2e7a178c22f3ba11c8deacc45904f9a0d812e2f83999775e6dc" }, "downloads": -1, "filename": "djangosampler-0.8.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "fdceb18b07d3db9588c7b6922785fdcc", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 26071, "upload_time": "2015-08-13T11:36:27", "url": "https://files.pythonhosted.org/packages/2b/09/633a4d4a764c7dac679b9d9cc006189cf9b4ab94fca646fdb6e2d6548955/djangosampler-0.8.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "6dedcf5351c0e99ea48f9db10a7f8da9", "sha256": "64904064fe6bf3e7f14dbbe222dc9034a044448485a1885d8d93b3d7f0858623" }, "downloads": -1, "filename": "djangosampler-0.8.0.tar.gz", "has_sig": false, "md5_digest": "6dedcf5351c0e99ea48f9db10a7f8da9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13158, "upload_time": "2015-08-13T11:36:23", "url": "https://files.pythonhosted.org/packages/f8/37/d16723a881d0f08d216cc34ab96750b57fc188f16fd2226f81b39cf75d30/djangosampler-0.8.0.tar.gz" } ], "0.9.0": [ { "comment_text": "built for Linux-3.2.0-37-generic-x86_64-with-glibc2.7", "digests": { "md5": "b66f9a4b19192c3a221d9dabf6fc962b", "sha256": "7a0403ebf667830d7d44f02f6d016fb1d14466a5327b6dc44a31f8d1136f270d" }, "downloads": -1, "filename": "djangosampler-0.9.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "b66f9a4b19192c3a221d9dabf6fc962b", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 26068, "upload_time": "2015-08-20T14:44:51", "url": "https://files.pythonhosted.org/packages/75/b9/d01f3a099ea8eae26c03c43b236bb9761f49d590d44a692968b128dbdc49/djangosampler-0.9.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "529ac04825e027aae50286eea5d257fc", "sha256": "1a7ef715e667fe9e6a452a62acb3977265b0eaa45fd2b1c46bd4ee5a35b61694" }, "downloads": -1, "filename": "djangosampler-0.9.0.tar.gz", "has_sig": false, "md5_digest": "529ac04825e027aae50286eea5d257fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13153, "upload_time": "2015-08-20T14:44:54", "url": "https://files.pythonhosted.org/packages/80/7d/1146c1c194130d61b16c03200c49c1c2d3420b248c1f559721ef3301ec76/djangosampler-0.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-3.2.0-37-generic-x86_64-with-glibc2.7", "digests": { "md5": "f83a2b10614e97d7e01e5350470eacb3", "sha256": "88d75fca616b8bd12660e4366e39e9ba6940650e37f7e290429346883cbd4201" }, "downloads": -1, "filename": "djangosampler-0.10.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "f83a2b10614e97d7e01e5350470eacb3", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 26003, "upload_time": "2015-11-17T10:21:31", "url": "https://files.pythonhosted.org/packages/cd/c0/16c3c29d5304c9f0611f79a32f5584e4d73cc39c609cb428a8c4722fae7e/djangosampler-0.10.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "f18b3b821f5b1690f425e071373425e1", "sha256": "59988208af850b915ff01071e2e81945e77d9ff3aaab681aa092daff9a328729" }, "downloads": -1, "filename": "djangosampler-0.10.0.tar.gz", "has_sig": false, "md5_digest": "f18b3b821f5b1690f425e071373425e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13130, "upload_time": "2015-11-17T10:21:02", "url": "https://files.pythonhosted.org/packages/b5/ff/672cef9a570977d49fb8a170970cf7905028b61a2806788d3d9454746ccb/djangosampler-0.10.0.tar.gz" } ] }