diff options
author | Thomas Stephens <thomas@ustudio.com> | 2013-07-11 09:25:29 -0500 |
---|---|---|
committer | Thomas Stephens <thomas@ustudio.com> | 2013-07-11 09:25:29 -0500 |
commit | 25f67f6c8cb0b391f1e3b11f23b94ae44c14e2bd (patch) | |
tree | cf9179b79187d5824e124957fc07c0b95b7cbe53 | |
parent | 5b152835126685c9b6e01a46f99d50336a3e61fc (diff) | |
download | pystatsd-25f67f6c8cb0b391f1e3b11f23b94ae44c14e2bd.tar.gz |
Adding reference for the set function; updating wording for the Set type reference
-rw-r--r-- | docs/reference.rst | 26 | ||||
-rw-r--r-- | docs/types.rst | 7 |
2 files changed, 31 insertions, 2 deletions
diff --git a/docs/reference.rst b/docs/reference.rst index df74e75..72f0fa9 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -154,6 +154,32 @@ Set a :ref:`gauge <gauge-type>` value. not be recorded. +.. _set: + +``set`` +========= + +:: + + StatsClient().set(stat, value, rate=1) + +Increment a :ref:`set <set-type>` value. + +* ``stat``: the name of the set to update. + +* ``value``: the unique value to count. + +* ``rate``: a sample rate, a float between 0 and 1. Will only send data + this percentage of the time. The statsd server does *not* take the + sample rate into account for sets. Use with care. + +.. note:: + + Sets were added to the statsd server in commit 1c10cfc0ac_. If you + try to use this method with an older version of the server, the + data will not be recorded. + + .. _pipeline: ``pipeline`` diff --git a/docs/types.rst b/docs/types.rst index bcb97fe..31a1f3d 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -142,6 +142,9 @@ keyword argument to ``True``. For example:: will need to be running at least that version for the ``delta`` kwarg to have any effect. + +.. _set-type: + Sets ====== @@ -152,8 +155,8 @@ using: statsd.set('users', userid) -If that method is called multiple times with the same userid, that -userid will only be counted once, for the sample period. +If that method is called multiple times with the same userid in the +same sample period, that userid will only be counted once. .. _statsd: https://github.com/etsy/statsd |