summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Socol <me@jamessocol.com>2014-05-09 11:15:48 -0400
committerJames Socol <me@jamessocol.com>2014-05-09 11:29:12 -0400
commite8143e8d6ff8403f411560e8c2cd15829731813b (patch)
tree73b0d474fbb28b991b794965dc53818b054de915
parent8efab684470c4fc5ab941564f96a60381e827fe0 (diff)
downloadpystatsd-e8143e8d6ff8403f411560e8c2cd15829731813b.tar.gz
Update documentation for v3
-rw-r--r--CHANGES6
-rw-r--r--docs/conf.py4
-rw-r--r--docs/configure.rst26
-rw-r--r--docs/contributing.rst4
-rw-r--r--docs/reference.rst1
-rw-r--r--docs/timing.rst12
6 files changed, 28 insertions, 25 deletions
diff --git a/CHANGES b/CHANGES
index 6a81a72..9b7cf7f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
Statsd Changelog
================
+Version 3.0
+-----------
+
+- Moved default client instances out of __init__.py. Now find them in
+ the `statsd.defaults.{django,env}` modules.
+
Version 2.1.2
-------------
diff --git a/docs/conf.py b/docs/conf.py
index d0ec1dc..4e75a4b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -48,9 +48,9 @@ copyright = u'2014, James Socol'
# built documents.
#
# The short X.Y version.
-version = '2.1'
+version = '3.0'
# The full version, including alpha/beta/rc tags.
-release = '2.1.2'
+release = '3.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/configure.rst b/docs/configure.rst
index 752898a..bc945e3 100644
--- a/docs/configure.rst
+++ b/docs/configure.rst
@@ -77,39 +77,35 @@ Here are the settings and their defaults::
You can use the default ``StatsClient`` simply::
- from statsd import statsd
+ from statsd.defaults.django import statsd
statsd.incr('foo')
-This instance will use the settings, if provided by Django. If no Django
-settings can be imported, it won't be available.
-
From the Environment
====================
Statsd isn't only useful in Django or on the web. A default instance
-will also be available if you configure at least two environment
-variables. These do not have defaults.
+can also be configured via environment variables.
-You can set these variables in the environment::
+Here are the environment variables and their defaults::
- STATSD_HOST
- STATSD_PORT
- STATSD_PREFIX
- STATSD_MAXUDPSIZE
+ STATSD_HOST=localhost
+ STATSD_PORT=8125
+ STATSD_PREFIX=None
+ STATSD_MAXUDPSIZE=512
and then in your Python application, you can simply do::
- from statsd import statsd
+ from statsd.defaults.env import statsd
statsd.incr('foo')
.. note::
- To make this default instance available, you will need to set at
- least ``STATSD_HOST`` and ``STATSD_PORT``, even if using the default
- values of ``localhost`` and ``8125``.
+ As of version 3.0, this default instance is always available,
+ configured with the default values, unless overridden by the
+ environment.
.. _statsd: https://github.com/etsy/statsd
.. _Django: https://www.djangoproject.com/
diff --git a/docs/contributing.rst b/docs/contributing.rst
index 08cf6e5..f700d5b 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -36,8 +36,8 @@ You can also run the tests with tox::
$ tox
-Tox will run the tests in Pythons 2.5, 2.6, 2.7, 3.2, 3.3, and PyPy, if
-they're available.
+Tox will run the tests in Pythons 2.5, 2.6, 2.7, 3.2, 3.3, 3.4, and
+PyPy, if they're available.
Writing Tests
diff --git a/docs/reference.rst b/docs/reference.rst
index 651944e..0c0202e 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -277,3 +277,4 @@ stats.
.. _statsd: https://github.com/etsy/statsd
.. _0ed78be: https://github.com/etsy/statsd/commit/0ed78be7
+.. _1c10cfc0ac: https://github.com/etsy/statsd/commit/1c10cfc0ac
diff --git a/docs/timing.rst b/docs/timing.rst
index 051f42e..ed85481 100644
--- a/docs/timing.rst
+++ b/docs/timing.rst
@@ -96,7 +96,7 @@ better than nested.)
# Do something fun.
foo_timer.stop()
-When :py:meth:`statsd.client.Timer.stop` is called, a `timing stat
+When :py:meth:`statsd.client.Timer.stop` is called, a :ref:`timing stat
<timer-type>`_ will automatically be sent to StatsD. You can over ride
this behavior with the ``send=False`` keyword argument to ``stop()``::
@@ -109,11 +109,11 @@ ready.
.. _timer-direct-note:
.. note::
- This use of timers is compatible with `Pipelines <pipeline-chapter>`_
- but be careful with the ``send()`` method. It *must* be called for
- the stat to be included when the Pipeline finally sends data, but
- ``send()`` will *not* immediately cause data to be sent in the
- context of a Pipeline. For example::
+ This use of timers is compatible with :ref:`Pipelines
+ <pipeline-chapter>`_ but be careful with the ``send()`` method. It
+ *must* be called for the stat to be included when the Pipeline
+ finally sends data, but ``send()`` will *not* immediately cause data
+ to be sent in the context of a Pipeline. For example::
with statsd.pipeline() as pipe:
foo_timer = pipe.timer('foo').start()