{ "info": { "author": "Rhys Elsmore", "author_email": "me@rhys.io", "bugtrack_url": null, "classifiers": [], "description": "log-metrics\n===========\n\nlog-metrics is a tiny metrics logger, based on the l2met format. Meant for use on\nHeroku, his allows you to send custom metrics to `Librato `_.\n\nYou can find more information on these custom metrics `here `_.\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n $ pip install log-metrics\n\n\nUsage\n-----\n\nEverything takes place from the log_metrics module, which can be imported like\nso:\n\n.. code-block:: pycon\n\n >>> import log_metrics\n\n\nSamples\n*******\n\n.. code-block:: pycon\n\n >>> log_metrics.sample('process.foo.memory.mb', '52.54')\n sample#process.foo.memory.mb=52.54\n\n\nMeasurements\n************\n\n.. code-block:: pycon\n\n >>> log_metrics.measure('myfoo.ms', '150')\n measure#myfoo.ms=150\n\n\nUniques\n*******\n\n.. code-block:: pycon\n\n >>> log_metrics.unique('user.clicked', 'bob')\n unique#user.clicked=bob\n >>> log_metrics.unique('user.clicked', 'joey')\n unique#user.clicked=joey\n >>> log_metrics.unique('user.clicked', 'jenny')\n unique#user.clicked=jenny\n\n\nCounters\n********\n\n.. code-block:: pycon\n\n >>> log_metrics.increment('myfoo')\n count#myfoo=1\n\n\n.. code-block:: pycon\n\n >>> log_metrics.increment('myfoo', 3)\n count#myfoo=3\n\n\nTimers\n******\n\n.. code-block:: pycon\n\n >>> with log_metrics.timer('my-timed-context'):\n ... time.sleep(1)\n measure#my-timed-context.ms=1001.20\n\n\n.. code-block:: pycon\n\n >>> @log_metrics.timer('my-timed-decorator'):\n ... def my_func():\n ... time.sleep(0.5)\n >>> my_func()\n measure#my-timed-decorator.ms=504.20\n\n\nMetric Groups\n*************\n\n.. code-block:: pycon\n\n >>> with log_metrics.group() as g:\n ... g.measure('my-measurement', 2)\n ... g.increment('my-counter')\n measure#my-measurement=2 count#my-counter=1\n\n\n.. code-block:: pycon\n\n >>> g = log_metrics.group()\n >>> g.measure('my-measurement', 2)\n >>> g.increment('my-counter')\n >>> g.emit()\n measure#my-measurement=2 count#my-counter=1\n\n\nSources and Prefixes\n********************\n\nSources and prefixes can be defined like so:\n\n.. code-block:: pycon\n\n >>> log_metrics.increment('my-counter', prefix='awesome')\n count#awesome.my-counter=1\n >>> log_metrics.measure('my-measurement', 50, source='testing')\n source=testing measure#my-measurement=50\n\n\nThese arguments are also supported for group functions:\n\n.. code-block:: pycon\n\n >>> g = log_metrics.group(prefix='my-prefix', source='my-metric-source')\n >>> g.increment('my-amount')\n >>> g.increment('my-measurement')\n >>> g.emit()\n source=my-metric-source count#my-prefix.my-amount=1 count#my-prefix.my-amount1=1 count#my-prefix.my-amount2=1\n\n\n\nHistory\n=======\n\n0.0.4 (2014-04-17)\n------------------\n\n* 'group' API now operational outside of a context manager.\n* Minor code changes.\n\n0.0.3 (2014-04-14)\n------------------\n\n* Introduced the 'group' API.\n\n0.0.2 (2014-04-14)\n------------------\n\n* Added more documentation for simple usage.\n* Worked on installation utilities.\n* Still no tests :(.\n\n0.0.1 (2014-04-14)\n------------------\n\n* Initial release.", "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/rhyselsmore/log-metrics", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "log-metrics", "package_url": "https://pypi.org/project/log-metrics/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/log-metrics/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rhyselsmore/log-metrics" }, "release_url": "https://pypi.org/project/log-metrics/0.0.4/", "requires_dist": null, "requires_python": null, "summary": "Python Metric Logger.", "version": "0.0.4" }, "last_serial": 1064004, "releases": { "0": [], "0.0.1": [ { "comment_text": "", "digests": { "md5": "7c39abe70d01c6762b33483e91bc1fc7", "sha256": "787c69d38f2bdac06915a6d91f0e9449a640262a12cc3ffed7250fe8f92d7a0a" }, "downloads": -1, "filename": "log-metrics-0.0.1.tar.gz", "has_sig": false, "md5_digest": "7c39abe70d01c6762b33483e91bc1fc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2305, "upload_time": "2014-04-14T16:36:59", "url": "https://files.pythonhosted.org/packages/52/6a/064fc3b744e0ff543596493da7b8383e36875893ab2a4cf58408f2bc79f5/log-metrics-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "edb57b6f3e2c90845622ec7a2f91634d", "sha256": "df43f71cccdff643df6d7fe61cc269170e4233c62bcfee0bd03909d053bd12c1" }, "downloads": -1, "filename": "log-metrics-0.0.2.tar.gz", "has_sig": false, "md5_digest": "edb57b6f3e2c90845622ec7a2f91634d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3562, "upload_time": "2014-04-14T17:49:44", "url": "https://files.pythonhosted.org/packages/c5/c8/97c6fcd9c20b5ede8b92958446af98179461be109fecf3fd0caed05896be/log-metrics-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "a9d8be5fd86a0229b2e47522bbab3129", "sha256": "893ff6fea326f139577aa6569b0eba93cf1216d0fadc9fe588b0a757fe82b479" }, "downloads": -1, "filename": "log-metrics-0.0.4.tar.gz", "has_sig": false, "md5_digest": "a9d8be5fd86a0229b2e47522bbab3129", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4418, "upload_time": "2014-04-17T22:55:38", "url": "https://files.pythonhosted.org/packages/a9/6d/5274c945fd62a78a2f6b12081ec8b4de105c2ede039ee5e42aac546a6ff9/log-metrics-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a9d8be5fd86a0229b2e47522bbab3129", "sha256": "893ff6fea326f139577aa6569b0eba93cf1216d0fadc9fe588b0a757fe82b479" }, "downloads": -1, "filename": "log-metrics-0.0.4.tar.gz", "has_sig": false, "md5_digest": "a9d8be5fd86a0229b2e47522bbab3129", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4418, "upload_time": "2014-04-17T22:55:38", "url": "https://files.pythonhosted.org/packages/a9/6d/5274c945fd62a78a2f6b12081ec8b4de105c2ede039ee5e42aac546a6ff9/log-metrics-0.0.4.tar.gz" } ] }