diff options
author | James Socol <james@bit.ly> | 2014-03-18 13:04:06 -0400 |
---|---|---|
committer | James Socol <james@bit.ly> | 2014-03-18 13:04:06 -0400 |
commit | 6f21e8593c68e04cdb7405ad1e49e9dd03569a7d (patch) | |
tree | 19626793e05cd6869af569283b704b13d16b8440 /docs | |
parent | 97cc0e10b0f86a23096c1197aeef74e3be5da75c (diff) | |
download | pystatsd-6f21e8593c68e04cdb7405ad1e49e9dd03569a7d.tar.gz |
Warn about non-safe decorators.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/reference.rst | 5 | ||||
-rw-r--r-- | docs/timing.rst | 5 |
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 ============================= |