Permalink
Browse files

Updating the docs

  • Loading branch information...
1 parent 0ee829f commit 3d6ccfeddc7ac384b05367d727ce01dc6a4b848a @frankwiles committed Sep 5, 2012
Showing with 93 additions and 17 deletions.
  1. +2 −3 README.rst
  2. +22 −6 docs/backends.rst
  3. +14 −0 docs/changelog.rst
  4. +2 −2 docs/conf.py
  5. +1 −1 docs/index.rst
  6. +2 −1 docs/install.rst
  7. +32 −3 docs/settings.rst
  8. +18 −1 docs/usage.rst
View
@@ -70,16 +70,15 @@ Usage
for x in some_long_list:
call_time_consuming_function(x)
- # Or if a context manager doesn't work for you you can use the Timer
- # class
+ # Or if a context manager doesn't work for you you can use a Timer class
t = Timer()
t.start()
something_that_takes_forever()
t.stop()
t.store('mytimer')
# Gauges are current status type dials (think fuel gauge in a car)
- # These simple store and retrieve a value
+ # These simply store and retrieve a value
gauge('current_fuel', '30')
guage('load_load', '3.14')
View
@@ -4,17 +4,33 @@ Backends
.. attribute:: app_metrics.backends.db
- This backend stores all metrics and aggregations in your database.
-
+ This backend stores all metrics and aggregations in your database.
+
.. admonition:: NOTE
- Every call to metric() generates a database write, which may
- decrease your overall performance is you go nuts with them or have
+ Every call to metric() generates a database write, which may
+ decrease your overall performance is you go nuts with them or have
a heavily traffic site.
.. _mixpanel_backend:
.. attribute:: app_metrics.backends.mixpanel
- This backend allows you to pipe all of your calls to metric() to Mixpanel.com
- See http://mixpanel.com/api/docs/ for more information on their
+ This backend allows you to pipe all of your calls to ``metric()`` to
+ Mixpanel. See the `Mixpanel documentation`_ for more information on
+ their API.
+
+.. _`Mixpanel documentation`: http://mixpanel.com/docs/api-documentation
+
+.. attribute:: app_metrics.backends.statsd
+
+ This backend allows you to pipe all of your calls to ``metric()`` to a
+ statsd server. See `statsd`_ for more information on their API.
+
+.. _`statsd`: https://github.com/etsy/statsd
+
+.. attribute:: app_metrics.backends.redis
+
+ This backend allows you to use the metric() and gauge() aspects, but not
+ timer aspects of app_metrics.
+
View
@@ -1,3 +1,17 @@
=========
Changelog
=========
+
+Version 0.8.0
+-------------
+
+ - Added Travis CI
+ - Added librato backend
+ - Added composite backends so you can send metrics to multiple backends automatically
+
+Previous Versions
+-----------------
+
+Haven't really kept a strict history here, but we can recreate it from git logs. In short
+several contributors have added different backends such as statsd, redis, language translations,
+and docs.
View
@@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
-version = '0.3.0'
+version = '0.8.0'
# The full version, including alpha/beta/rc tags.
-release = '0.3.0'
+release = '0.8.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
View
@@ -6,7 +6,7 @@
==================
Django App Metrics
==================
-Django App Metrics allows you to capture and report on various events in your
+Django App Metrics allows you to capture and report on various events in your
applications.
Contents:
View
@@ -7,7 +7,7 @@ Installing
* Install with pip::
- pip install git+https://github.com/frankwiles/django-app-metrics.git
+ pip install django-app-metrics
* Add ``app_metrics`` to your ``INSTALLED_APPS`` setting::
@@ -24,3 +24,4 @@ celery and django-celery must be installed, however if you do not wish to
actually use celery you can simply set CELERY_ALWAYS_EAGER = True in your
settings and it will behave as if celery was not configured.
+Django 1.2 or higher required.
View
@@ -9,17 +9,46 @@ Base Settings
=============
.. attribute:: APP_METRICS_BACKEND
- Defaults to :attr:`app_metrics.backends.db` if not defined.
+ Defaults to :attr:`app_metrics.backends.db` if not defined.
Mixpanel Backend Settings
=========================
These settings are only necessary if you're using the :ref:`Mixpanel backend<mixpanel_backend>`
.. attribute:: APP_METRICS_MIXPANEL_TOKEN
-
- Your Mixpanel.com API token
+
+ Your Mixpanel.com API token
.. attribute:: APP_METERICS_MIXPANEL_URL
Allow overriding of the API URL end point
+Statsd Settings
+===============
+
+.. attribute:: APP_METRICS_STATSD_HOST
+
+ Hostname of statsd server, defaults to 'localhost'
+
+.. attribute:: APP_METRICS_STATSD_PORT
+
+ statsd port, defaults to '8125'
+
+.. attribute:: APP_METRICS_STATSD_SAMPLE_RATE
+
+ statsd sample rate, defaults to 1
+
+Redis Settings
+==============
+
+.. attribute:: APP_METRICS_REDIS_HOST
+
+ Hostname of redis server, defaults to 'localhost'
+
+.. attribute:: APP_METRICS_REDIS_PORT
+
+ redis port, defaults to '6379'
+
+.. attribute:: APP_METRICS_REDIS_DB
+
+ redis database number to use, defaults to 0
View
@@ -31,6 +31,23 @@ Example::
# Increment the metric by some other number
metric('new_user_signup', 4)
+ # Create a timer (only supported in statsd backend currently)
+ with timing('mytimer'):
+ for x in some_long_list:
+ call_time_consuming_function(x)
+
+ # Or if a context manager doesn't work for you you can use a Timer class
+ t = Timer()
+ t.start()
+ something_that_takes_forever()
+ t.stop()
+ t.store('mytimer')
+
+ # Gauges are current status type dials (think fuel gauge in a car)
+ # These simply store and retrieve a value
+ gauge('current_fuel', '30')
+ guage('load_load', '3.14')
+
Management Commands
===================
@@ -52,4 +69,4 @@ Send email reports to users. The email will be sent out using django_mailer_'s `
.. _django_mailer: https://github.com/jtauber/django-mailer/
-.. _django.core.mail: https://docs.djangoproject.com/en/1.3/topics/email/
+.. _django.core.mail: https://docs.djangoproject.com/en/dev/topics/email/

0 comments on commit 3d6ccfe

Please sign in to comment.