{ "info": { "author": "Pior Bastida", "author_email": "pior@pbastida.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pyramid", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP :: WSGI" ], "description": "===============\nPyramid_metrics\n===============\n\nPerformance metrics for Pyramid using StatsD. The project aims at providing\nways to instrument a Pyramid application in the least intrusive way.\n\n* PyPI: https://pypi.python.org/pypi/pyramid_metrics\n* Github: https://github.com/ludia/pyramid_metrics\n* |travis|\n\n.. |travis| image::\n https://travis-ci.org/ludia/pyramid_metrics.svg?branch=master\n :target: https://travis-ci.org/ludia/pyramid_metrics\n :alt: Tests on TravisCI\n\n\nInstallation\n============\n\nInstall using setuptools, e.g. (within a virtualenv)::\n\n $ pip install pyramid_metrics\n\n\nSetup\n=====\n\nOnce ``pyramid_metrics`` is installed, you must use the ``config.include``\nmechanism to include it into your Pyramid project's configuration. In your\nPyramid project's ``__init__.py``:\n\n.. code-block:: python\n\n config = Configurator(.....)\n config.include('pyramid_metrics')\n\nAlternately you can use the ``pyramid.includes`` configuration value in your\n``.ini`` file:\n\n.. code-block:: ini\n\n [app:myapp]\n pyramid.includes = pyramid_metrics\n\n\nUsage\n=====\n\nPyramid_metrics configuration (values are defaults):\n\n.. code-block:: ini\n\n [app:myapp]\n metrics.host = localhost\n metrics.port = 8125\n\n metrics.prefix = application.stage\n\n metrics.route_performance = true\n\n\nRoute performance\n=================\n\nIf enabled, the route performance feature will time the request processing.\nBy using the StatsD Timer type metric, pre-aggregation will provide information\non latency, rate and total number. The information is sent two times: per route\nand globally.\n\nThe key name is composed of the route name,\nthe HTTP method and the outcome (as HTTP status code or 'exc' for exception).\n\n- Global key ``request..``\n- Per route key ``route..request..``\n\n\nAPI\n===\n\nCounter\n-------\n\nStatsD type:\nhttps://github.com/etsy/statsd/blob/master/docs/metric_types.md#counting\n\n.. code-block:: python\n\n # Increment a counter named cache.hit by 1\n request.metrics.incr('cache.hit')\n\n # Increment by N\n request.metrics.incr(('cache.hit.read.total', count=len(cacheresult)))\n\n # Stat names can be composed from list or tuple\n request.metrics.incr(('cache', cache_action))\n\n\nGauge\n-----\n\nStatsD type:\nhttps://github.com/etsy/statsd/blob/master/docs/metric_types.md#gauges\n\n.. code-block:: python\n\n # Set the number of SQL connections to 8\n request.metrics.gauge('sql.connections', 8)\n\n # Increase the value of the metrics by some amount\n request.metrics.gauge('network.egress', 34118, delta=True)\n\n\nTimer\n-----\n\nStatsD type:\nhttps://github.com/etsy/statsd/blob/master/docs/metric_types.md#timing\n\n.. code-block:: python\n\n # Simple timing\n time_in_ms = requests.get('http://example.net').elapsed.microseconds/1000\n request.metrics.timing('net.example.responsetime', time_in_ms)\n\n # Using the time marker mechanism\n request.metrics.marker_start('something_slow')\n httpclient.get('http://example.net')\n request.metrics.marker_stop('something_slow')\n\n # Measure different outcome\n request.metrics.marker_start('something_slow')\n try:\n httpclient.get('http://example.net').raise_for_status()\n except:\n # Send measure to key 'something_slow.error'\n request.metrics.marker_stop('something_slow', suffix='error')\n else:\n # Send measure to key 'something_slow.ok'\n request.metrics.marker_stop('something_slow', suffix='ok')\n\n # Using the context manager\n with request.metrics.timer(['longprocess', processname]):\n run_longprocess(processname)\n # Send measure to 'longprocess.foobar' or 'longprocess.foobar.exc'\n\nCurrently implemented\n=====================\n\n- Collection utility as a request method\n- Ability to send metrics per Pyramid route\n- Simple time marker mechanism\n- Simple counter\n- Context manager for Timing metric type\n\n\nTODO\n====\n\n- Full StatsD metric types\n- Extensions for automatic metrology (SQLAlchemy, MongoDB, Requests...)\n- Whitelist/blacklist of metrics\n- Time allocation per subsystem (using the time marker mechanism)\n\n\nConsiderations\n==============\n\n- The general error policy is: always failsafe. Pyramid_metrics should NEVER\n break your application.\n- The DNS resolution is done during configuration to avoid recurring latencies.\n\nDevelopment\n===========\n\nRun tests\n---------\n\nThe tests are run by nose and all dependencies are in requirements-test.txt.\n\n.. code-block:: shell\n\n $ pip install -r requirements-test\n ...\n\n $ nosetests\n ...\n\n\nRun tests with tox\n------------------\n\n.. code-block:: shell\n\n $ pip install tox\n ...\n\n $ tox # Run on python 2.7 and python 3.4\n ...\n\n $ tox -e py34 # Run on python 3.4 only\n\n\nContributors\n============\n\n- Pior Bastida (@pior)\n- Philippe Gauthier (@deuxpi)\n- Hadrien David (@hadrien)\n- Jay R. Wren (@jrwren)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ludia/pyramid_metrics", "keywords": "wsgi pylons pyramid statsd metric tween handler", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "pyramid_metrics", "package_url": "https://pypi.org/project/pyramid_metrics/", "platform": "", "project_url": "https://pypi.org/project/pyramid_metrics/", "project_urls": { "Homepage": "https://github.com/ludia/pyramid_metrics" }, "release_url": "https://pypi.org/project/pyramid_metrics/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Performance metrics for Pyramid using StatsD", "version": "0.3.1" }, "last_serial": 3043509, "releases": { "0.0.1.dev1": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "695fab49abd3d57110e6e62994d0c5ed", "sha256": "b4cb55e6cf006f2336edd54e86ae14979ccc5b1b9977ce343112ab66ec73866f" }, "downloads": -1, "filename": "pyramid_metrics-0.1.0.tar.gz", "has_sig": false, "md5_digest": "695fab49abd3d57110e6e62994d0c5ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6173, "upload_time": "2014-05-06T19:58:05", "url": "https://files.pythonhosted.org/packages/92/17/617358e399529541bee7e54ec7c14eee913ab3895fe3d757a6f9ab6d1c98/pyramid_metrics-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b327c7c0ca865190357c282d505ef9dc", "sha256": "26221a96735d499ec03cbc4db65b96379a35b86d43cee7dc49ac2a822256d025" }, "downloads": -1, "filename": "pyramid_metrics-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b327c7c0ca865190357c282d505ef9dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6186, "upload_time": "2014-05-06T20:24:40", "url": "https://files.pythonhosted.org/packages/c0/20/793ef6a41cc090f7b90244c819bacb3313ed2adabfb8c6e0076872118af2/pyramid_metrics-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "10f0964964d63168c5f96e3b5e48fbc9", "sha256": "f2cfdb4d99f0b75e06b954aa5d2399aa7f4136cb5c67fb121eb1284fec558a6a" }, "downloads": -1, "filename": "pyramid_metrics-0.1.2.tar.gz", "has_sig": false, "md5_digest": "10f0964964d63168c5f96e3b5e48fbc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6321, "upload_time": "2014-05-07T16:33:59", "url": "https://files.pythonhosted.org/packages/96/b7/8a001f03b9af20fa02021a8d5d3a6b4ee9e7ca76093c0caafa7f83d7403e/pyramid_metrics-0.1.2.tar.gz" } ], "0.1.3": [], "0.1.4": [ { "comment_text": "", "digests": { "md5": "2f96f8b5c76f8df9ae90a1e4223e7eb3", "sha256": "f90a066320328f766b6c9a0175248489641da3f6f0390c882ea50d7c02197209" }, "downloads": -1, "filename": "pyramid_metrics-0.1.4.tar.gz", "has_sig": false, "md5_digest": "2f96f8b5c76f8df9ae90a1e4223e7eb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8698, "upload_time": "2014-05-08T14:58:24", "url": "https://files.pythonhosted.org/packages/4c/39/a40643ab7c3892f8256fc8b5965086608c90f861230f0351da7eb8bcff53/pyramid_metrics-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "97e1470d6fdd452fed8376d784e232be", "sha256": "849314cecdea161e7e61df4c4cbd7b0a631b240b6b0becaf727d9104129302aa" }, "downloads": -1, "filename": "pyramid_metrics-0.1.5.tar.gz", "has_sig": false, "md5_digest": "97e1470d6fdd452fed8376d784e232be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8896, "upload_time": "2014-05-30T16:38:49", "url": "https://files.pythonhosted.org/packages/5d/1c/302199adf3b10388c3bdc841bad4aa01a9733a3f519d641489eb4b92fb54/pyramid_metrics-0.1.5.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "13e105bf01ec88b132f0dc5e09d7bb26", "sha256": "9338cb4bf35c08b04e3f8855584ae0b71a32344f268d359a352283a38dd9beaf" }, "downloads": -1, "filename": "pyramid_metrics-0.2.0.tar.gz", "has_sig": false, "md5_digest": "13e105bf01ec88b132f0dc5e09d7bb26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9774, "upload_time": "2014-08-19T18:27:33", "url": "https://files.pythonhosted.org/packages/dc/64/78d80f1deea976a50696dbcc501b5fd2533c2cf099404e6fdb83bed4e548/pyramid_metrics-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "12fc0b5bd6bf7502788bf359803c90fd", "sha256": "09464a5aa5773abb49f95a1ac4044ae7f0f418135a2ae4e6a35d6afe2206ea77" }, "downloads": -1, "filename": "pyramid_metrics-0.3.0.tar.gz", "has_sig": false, "md5_digest": "12fc0b5bd6bf7502788bf359803c90fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9370, "upload_time": "2015-06-06T20:18:22", "url": "https://files.pythonhosted.org/packages/b1/62/77451de259e92500b5fed3866778ca6e8d869de853b0111087b4f631dd65/pyramid_metrics-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "1c3aee42891847fbc22029fba82d2ea3", "sha256": "923426cfcd70eb3c4e7af690c5ac4d989fc33f2dd46b5ed2440924656e9814ec" }, "downloads": -1, "filename": "pyramid_metrics-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1c3aee42891847fbc22029fba82d2ea3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14653, "upload_time": "2017-07-23T19:56:06", "url": "https://files.pythonhosted.org/packages/ad/e1/76492184d57c859b6ba18b334111ca55b48d36b60a8eae8f7afff928c29c/pyramid_metrics-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ddd84babecf40161346861fbe77da9f2", "sha256": "2d6f89e49788c76ce351affd2974110ffe6138f78dc788c6755e2c27b9e7a6a5" }, "downloads": -1, "filename": "pyramid_metrics-0.3.1.tar.gz", "has_sig": false, "md5_digest": "ddd84babecf40161346861fbe77da9f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10712, "upload_time": "2017-07-23T19:54:17", "url": "https://files.pythonhosted.org/packages/f7/d4/a81709341e8d9c36e40727f05d80b52dfc731430e132627d440d290989f4/pyramid_metrics-0.3.1.tar.gz" } ], "0.3.1.dev0": [ { "comment_text": "", "digests": { "md5": "62c1bd974b8977018062216fd83c97de", "sha256": "741a353772db36f36cfbcc343cf47c3d64fedf403524183f1cf12e0210a8cd20" }, "downloads": -1, "filename": "pyramid_metrics-0.3.1.dev0.tar.gz", "has_sig": false, "md5_digest": "62c1bd974b8977018062216fd83c97de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10694, "upload_time": "2017-07-23T18:56:39", "url": "https://files.pythonhosted.org/packages/7b/ae/65105b004f79a8b4c5e4212d77b2ec496abb04ed71de1a1ecd9590d73975/pyramid_metrics-0.3.1.dev0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1c3aee42891847fbc22029fba82d2ea3", "sha256": "923426cfcd70eb3c4e7af690c5ac4d989fc33f2dd46b5ed2440924656e9814ec" }, "downloads": -1, "filename": "pyramid_metrics-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1c3aee42891847fbc22029fba82d2ea3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14653, "upload_time": "2017-07-23T19:56:06", "url": "https://files.pythonhosted.org/packages/ad/e1/76492184d57c859b6ba18b334111ca55b48d36b60a8eae8f7afff928c29c/pyramid_metrics-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ddd84babecf40161346861fbe77da9f2", "sha256": "2d6f89e49788c76ce351affd2974110ffe6138f78dc788c6755e2c27b9e7a6a5" }, "downloads": -1, "filename": "pyramid_metrics-0.3.1.tar.gz", "has_sig": false, "md5_digest": "ddd84babecf40161346861fbe77da9f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10712, "upload_time": "2017-07-23T19:54:17", "url": "https://files.pythonhosted.org/packages/f7/d4/a81709341e8d9c36e40727f05d80b52dfc731430e132627d440d290989f4/pyramid_metrics-0.3.1.tar.gz" } ] }