{ "info": { "author": "Frank Wiles", "author_email": "frank@revsys.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "Django App Metrics\n==================\n\n.. image:: https://secure.travis-ci.org/frankwiles/django-app-metrics.png\n :alt: Build Status\n :target: http://travis-ci.org/frankwiles/django-app-metrics\n\ndjango-app-metrics allows you to capture and report on various events in your\napplications. You simply define various named metrics and record when they\nhappen. These might be certain events that may be immediatey useful, for\nexample 'New User Signups', 'Downloads', etc.\n\nOr they might not prove useful until some point in the future. But if you\nbegin recording them now you'll have great data later on if you do need it.\n\nFor example 'Total Items Sold' isn't an exciting number when you're just\nlaunching when you only care about revenue, but being able to do a contest\nfor the 1 millionth sold item in the future you'll be glad you were tracking\nit.\n\nYou then group these individual metrics into a MetricSet, where you define\nhow often you want an email report being sent, and to which User(s) it should\nbe sent.\n\nDocumentation\n=============\n\nDocumentation can be found at ReadTheDocs_.\n\n.. _ReadTheDocs: http://django-app-metrics.readthedocs.org/\n\nRequirements\n============\n\nCelery_ and `django-celery`_ must be installed, however if you do not wish to\nactually use Celery you can simply set ``CELERY_ALWAYS_EAGER = True`` in your\nsettings and it will behave as if Celery was not configured.\n\n.. _Celery: http://celeryproject.org/\n.. _`django-celery`: http://ask.github.com/django-celery/\n\nDjango 1.2 and above\n\nUsage\n=====\n\n::\n\n from app_metrics.utils import create_metric, metric, timing, Timer, gauge\n\n # Create a new metric to track\n my_metric = create_metric(name='New User Metric', slug='new_user_signup')\n\n # Create a MetricSet which ties a metric to an email schedule and sets\n # who should receive it\n my_metric_set = create_metric_set(name='My Set',\n metrics=[my_metric],\n email_recipients=[user1, user2])\n\n # Increment the metric by one\n metric('new_user_signup')\n\n # Increment the metric by some other number\n metric('new_user_signup', 4)\n\n # Aggregate metric items into daily, weekly, monthly, and yearly totals\n # It's fairly smart about it, so you're safe to run this as often as you\n # like\n manage.py metrics_aggregate\n\n # Send email reports to users\n manage.py metrics_send_mail\n\n # Create a timer (only supported in statsd backend currently)\n with timing('mytimer'):\n for x in some_long_list:\n call_time_consuming_function(x)\n\n # Or if a context manager doesn't work for you you can use a Timer class\n t = Timer()\n t.start()\n something_that_takes_forever()\n t.stop()\n t.store('mytimer')\n\n # Gauges are current status type dials (think fuel gauge in a car)\n # These simply store and retrieve a value\n gauge('current_fuel', '30')\n guage('load_load', '3.14')\n\nBackends\n========\n\n``app_metrics.backends.db`` (Default) - This backend stores all metrics and\naggregations in your database. NOTE: Every call to ``metric()`` generates a\ndatabase write, which may decrease your overall performance is you go nuts\nwith them or have a heavily traffic site.\n\n``app_metrics.backends.mixpanel`` - This backend allows you to pipe all of\nyour calls to ``metric()`` to Mixpanel. See the `Mixpanel documentation`_\nfor more information on their API.\n\n.. _`Mixpanel documentation`: http://mixpanel.com/docs/api-documentation\n\n``app_metrics.backends.statsd`` - This backend allows you to pipe all of your\ncalls to ``metric()`` to a statsd server. See `statsd`_ for more information\non their API.\n\n.. _`statsd`: https://github.com/etsy/statsd\n\n``app_metrics.backends.redis`` - This backend allows you to use the metric() and\ngauge() aspects, but not timer aspects of app_metrics.\n\n``app_metrics.backends.librato_backend`` - This backend lets you send metrics to\nLibrato. See the `Librato documentation`_ for more information on their API.\nThis requires the `Librato library`_. It uses use a librato Gauge by default,\nalthough this can be overridden by supplying ``metric_type=\"counter\"`` as a\nkeyword arg to ``metric()``.\n\n.. _`Librato documentation`: http://dev.librato.com/v1/metrics#metrics\n.. _`Librato library`: http://pypi.python.org/pypi/librato/0.2\n\n``app_metrics.backends.composite`` - This backend lets you compose multiple\nbackends to which metric-calls are handed. The backends to which the call is\nsent can be configured with the ``APP_METRICS_COMPOSITE_BACKENDS`` setting. This\ncan be overridden in each call by supplying a ``backends`` keyword argument::\n\n metric('signups', 42, backends=['app_metrics.backends.librato',\n 'app_metrics.backends.db'])\n\n\nSettings\n========\n\n``APP_METRICS_BACKEND`` - Defaults to 'app_metrics.backends.db' if not defined.\n\n``APP_METRICS_SEND_ZERO_ACTIVITY`` - Prevent e-mails being sent when there's been\nno activity today (i.e. during testing). Defaults to `True`.\n\n``APP_METRICS_DISABLED`` - If `True`, do not track metrics, useful for\ndebugging. Defaults to `False`.\n\nMixpanel Settings\n-----------------\nSet ``APP_METRICS_BACKEND`` == 'app_metrics.backends.mixpanel'.\n\n``APP_METRICS_MIXPANEL_TOKEN`` - Your Mixpanel.com API token\n\n``APP_METRICS_MIXPANEL_URL`` - Allow overriding of the API URL end point\n\nStatsd Settings\n---------------\nSet ``APP_METRICS_BACKEND`` == 'app_metrics.backends.statsd'.\n\n``APP_METRICS_STATSD_HOST`` - Hostname of statsd server, defaults to 'localhost'\n\n``APP_METRICS_STATSD_PORT`` - statsd port, defaults to '8125'\n\n``APP_METRICS_STATSD_SAMPLE_RATE`` - statsd sample rate, defaults to 1\n\nRedis Settings\n--------------\nSet ``APP_METRICS_BACKEND`` == 'app_metrics.backends.redis'.\n\n``APP_METRICS_REDIS_HOST`` - Hostname of redis server, defaults to 'localhost'\n\n``APP_METRICS_REDIS_PORT`` - redis port, defaults to '6379'\n\n``APP_METRICS_REDIS_DB`` - redis database number to use, defaults to 0\n\nLibrato Settings\n----------------\nSet ``APP_METRICS_BACKEND`` == 'app_metrics.backends.librato'.\n\n``APP_METRICS_LIBRATO_USER`` - Librato username\n\n``APP_METRICS_LIBRATO_TOKEN`` - Librato API token\n\n``APP_METRICS_LIBRATO_SOURCE`` - Librato data source (e.g. 'staging', 'dev'...)\n\nComposite Backend Settings\n--------------------------\nSet ``APP_METRICS_BACKEND`` == 'app_metrics.backends.composite'.\n\n``APP_METRICS_COMPOSITE_BACKENDS`` - List of backends that are used by default,\ne.g.::\n\n APP_METRICS_COMPOSITE_BACKENDS = ('librato', 'db', 'my_custom_backend',)\n\nRunning the tests\n=================\n\nTo run the tests you'll need some requirements installed, so run::\n\n pip install -r requirements/test.txt\n\nThen simply run::\n\n django-admin.py test --settings=app_metrics.tests.settings\n\nTODO\n----\n\n- Improve text and HTML templates to display trending data well", "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/frankwiles/django-app-metrics", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-app-metrics", "package_url": "https://pypi.org/project/django-app-metrics/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-app-metrics/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/frankwiles/django-app-metrics" }, "release_url": "https://pypi.org/project/django-app-metrics/0.9.0/", "requires_dist": null, "requires_python": null, "summary": "django-app-metrics is a reusable Django application for tracking and emailing application metrics.", "version": "0.9.0" }, "last_serial": 789096, "releases": { "0.4.0": [ { "comment_text": "", "digests": { "md5": "1f0c25f2a0073312d1f07858ba061b45", "sha256": "9175ed7b9be1560563b563312795feb924eff0a752210df59d004668bada57eb" }, "downloads": -1, "filename": "django-app-metrics-0.4.0.tar.gz", "has_sig": false, "md5_digest": "1f0c25f2a0073312d1f07858ba061b45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11154, "upload_time": "2012-04-25T23:25:45", "url": "https://files.pythonhosted.org/packages/e3/cb/eff7e8b87291263e1f7b37ae7aec91f5c9336308a1dd3735c3ab98c5e840/django-app-metrics-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "0b2d6b9d91906cae1490d82a675be23d", "sha256": "a8711bf6a0351ddd2beeccebf3abe934ef0acc1b11f4ef62407bd2a21002866c" }, "downloads": -1, "filename": "django-app-metrics-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0b2d6b9d91906cae1490d82a675be23d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12120, "upload_time": "2012-05-03T17:08:22", "url": "https://files.pythonhosted.org/packages/b3/46/78bd3f8bdfea79117fa13aa42ae5e9535acc5ce55c9d2f9ec634abe62664/django-app-metrics-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "60c58c179ef53153939dc12c53ffb175", "sha256": "e246210519a535201e8f9bc8389a3530564312bc2f2d45ce4953e33919e10086" }, "downloads": -1, "filename": "django-app-metrics-0.5.1.tar.gz", "has_sig": false, "md5_digest": "60c58c179ef53153939dc12c53ffb175", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13334, "upload_time": "2012-05-08T00:00:51", "url": "https://files.pythonhosted.org/packages/a6/ca/1596a0c5ae03c7ceac4982f4ddad2673fe296185aa80e4c9112e35f210f7/django-app-metrics-0.5.1.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "62f3543fa9a80c091c29e6e8b705e8ba", "sha256": "8ed48aac508f36a01db1522ebbf2c0f647da1451801024debeb220beaf42f6c3" }, "downloads": -1, "filename": "django-app-metrics-0.6.0.tar.gz", "has_sig": false, "md5_digest": "62f3543fa9a80c091c29e6e8b705e8ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16083, "upload_time": "2012-05-14T22:22:49", "url": "https://files.pythonhosted.org/packages/13/5a/101b21541cfdfc4a92e674383703c22ae6716bc931f7dda00e2a58ca3743/django-app-metrics-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "5a5d9e746d6719890cb4bbdeeaaec28c", "sha256": "b6e46292e5a7ba643479f96c25986b2cfa63dd64fcdf7ce79b5ce0a968fa0a03" }, "downloads": -1, "filename": "django-app-metrics-0.7.0.tar.gz", "has_sig": false, "md5_digest": "5a5d9e746d6719890cb4bbdeeaaec28c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17156, "upload_time": "2012-05-22T20:39:10", "url": "https://files.pythonhosted.org/packages/29/a7/a70795d857e1e5e13533cadf576e5c97909580a94a11615183138999e286/django-app-metrics-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "eb9ad6e14195d52b4929ea88e23b933d", "sha256": "19b07858d1d792011145ec32b2d4fb273dc484dafc2b15dcfb6a66e6f9d2191e" }, "downloads": -1, "filename": "django-app-metrics-0.7.1.tar.gz", "has_sig": false, "md5_digest": "eb9ad6e14195d52b4929ea88e23b933d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17483, "upload_time": "2012-06-05T16:52:48", "url": "https://files.pythonhosted.org/packages/42/c9/2af934f7172ee0edf3cded5a3c3323c60c37068cb764baef3d726199ff8d/django-app-metrics-0.7.1.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "5a6f9039e754aa2cb661d01e5139d423", "sha256": "85f902e96b009f3b99807710be45eca0ef24855fe8ada4a326e00f4b78821d92" }, "downloads": -1, "filename": "django-app-metrics-0.8.0.tar.gz", "has_sig": false, "md5_digest": "5a6f9039e754aa2cb661d01e5139d423", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19548, "upload_time": "2012-09-06T21:47:25", "url": "https://files.pythonhosted.org/packages/b1/b2/e29ee94cdf43faebee60494c9d6074338dcb9e92f1c56a11ddc581436067/django-app-metrics-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "011f539959eca0fad8749d39460688aa", "sha256": "75d888c0e9a4ede287a363ad4ed56b82df52c9cb063f8fd6a478bcad7252fe61" }, "downloads": -1, "filename": "django-app-metrics-0.8.1.tar.gz", "has_sig": false, "md5_digest": "011f539959eca0fad8749d39460688aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19551, "upload_time": "2012-09-06T22:12:35", "url": "https://files.pythonhosted.org/packages/d9/3e/48815fb00b89b4f09857de82c575179a01009e1cd03497721502064a20c0/django-app-metrics-0.8.1.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "673ce49810ec77c29f550bcc8d60deab", "sha256": "140a2267f19c43c60a09e821b702dd01a9873065a40150bad7319b96a0f86c85" }, "downloads": -1, "filename": "django-app-metrics-0.9.0.tar.gz", "has_sig": false, "md5_digest": "673ce49810ec77c29f550bcc8d60deab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19725, "upload_time": "2013-03-03T19:45:58", "url": "https://files.pythonhosted.org/packages/ba/51/05d6d999634ccd805463d68f782c27846f4c8fc8ceb288691b547a7878f9/django-app-metrics-0.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "673ce49810ec77c29f550bcc8d60deab", "sha256": "140a2267f19c43c60a09e821b702dd01a9873065a40150bad7319b96a0f86c85" }, "downloads": -1, "filename": "django-app-metrics-0.9.0.tar.gz", "has_sig": false, "md5_digest": "673ce49810ec77c29f550bcc8d60deab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19725, "upload_time": "2013-03-03T19:45:58", "url": "https://files.pythonhosted.org/packages/ba/51/05d6d999634ccd805463d68f782c27846f4c8fc8ceb288691b547a7878f9/django-app-metrics-0.9.0.tar.gz" } ] }