summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJames Socol <james@bit.ly>2014-03-18 13:04:06 -0400
committerJames Socol <james@bit.ly>2014-03-18 13:04:06 -0400
commit6f21e8593c68e04cdb7405ad1e49e9dd03569a7d (patch)
tree19626793e05cd6869af569283b704b13d16b8440 /docs
parent97cc0e10b0f86a23096c1197aeef74e3be5da75c (diff)
downloadpystatsd-6f21e8593c68e04cdb7405ad1e49e9dd03569a7d.tar.gz
Warn about non-safe decorators.
Diffstat (limited to 'docs')
-rw-r--r--docs/reference.rst5
-rw-r--r--docs/timing.rst5
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/reference.rst b/docs/reference.rst
index 09a390e..d2c0aa6 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -183,6 +183,11 @@ call. See also the :ref:`chapter on timing <timing-chapter>`.
this percentage of the time. The statsd server does *not* take the
sample rate into account for timers.
+.. warning:
+ Decorators are not thread-safe and may cause errors when decorated
+ functions are called concurrently. Use context managers or raw timers
+ instead.
+
.. _timer-start:
diff --git a/docs/timing.rst b/docs/timing.rst
index 8608db0..d077aa4 100644
--- a/docs/timing.rst
+++ b/docs/timing.rst
@@ -70,6 +70,11 @@ be sent to the statsd server.
myfunc(1, 2)
myfunc(3, 7)
+.. warning:
+ Decorators are not thread-safe and may cause errors when decorated
+ functions are called concurrently. Use context managers or raw timers
+ instead.
+
Using a Timer object directly
=============================