No description
Find a file
James Socol c687a4e6bc
Some checks failed
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.7) (push) Has been cancelled
CI / test (ubuntu-latest, 3.8) (push) Has been cancelled
CI / test (ubuntu-latest, 3.9) (push) Has been cancelled
CI / test (ubuntu-latest, pypy-3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CodeQL / Analyze (push) Failing after 15s
Merge pull request #183 from thejcannon/patch-1
Fix missing parens in docs
2023-07-27 15:46:47 -04:00
.github Allow manual trigger of workflow runs 2023-07-27 15:39:45 -04:00
docs Update reference.rst 2023-07-27 15:43:35 -04:00
statsd pyupgrade: Modernize syntax for Python >= 3.7 2022-12-03 18:21:40 -05:00
.gitignore Ignore swap files and build artifacts. 2014-01-03 01:53:24 -05:00
AUTHORS Bug: Fix timer decorator with partial functions (#85) 2017-08-30 13:06:23 +02:00
CHANGELOG.md Release v4.0.1 2022-11-06 09:12:23 -05:00
LICENSE Update License and copyright. 2012-08-06 11:45:03 -04:00
MANIFEST.in First pass at proper docs. 2012-04-10 13:20:33 -04:00
pyproject.toml Release v4.0.1 2022-11-06 09:12:23 -05:00
README.rst Replace README badge for real 2022-11-05 18:01:42 -04:00
requirements.txt Replace nose with nose2 2022-11-05 17:21:32 -04:00
tox.ini tox.ini: isolated_build = True 2022-11-05 19:41:24 -04:00

======================
A Python statsd client
======================

statsd_ is a friendly front-end to Graphite_. This is a Python client
for the statsd daemon.

.. image:: https://github.com/jsocol/pystatsd/actions/workflows/ci.yml/badge.svg
   :target: https://github.com/jsocol/pystatsd/actions/workflows/ci.yml
   :alt: Latest CI status

.. image:: https://img.shields.io/pypi/v/statsd.svg
   :target: https://pypi.python.org/pypi/statsd/
   :alt: Latest release

.. image:: https://img.shields.io/pypi/pyversions/statsd.svg
   :target: https://pypi.python.org/pypi/statsd/
   :alt: Supported Python versions

.. image:: https://img.shields.io/pypi/wheel/statsd.svg
   :target: https://pypi.python.org/pypi/statsd/
   :alt: Wheel Status

:Code:          https://github.com/jsocol/pystatsd
:License:       MIT; see LICENSE file
:Issues:        https://github.com/jsocol/pystatsd/issues
:Documentation: https://statsd.readthedocs.io/

Quickly, to use:

.. code-block:: python

    >>> import statsd
    >>> c = statsd.StatsClient('localhost', 8125)
    >>> c.incr('foo')  # Increment the 'foo' counter.
    >>> c.timing('stats.timed', 320)  # Record a 320ms 'stats.timed'.

You can also add a prefix to all your stats:

.. code-block:: python

    >>> import statsd
    >>> c = statsd.StatsClient('localhost', 8125, prefix='foo')
    >>> c.incr('bar')  # Will be 'foo.bar' in statsd/graphite.


Installing
==========

The easiest way to install statsd is with pip!

You can install from PyPI::

    $ pip install statsd

Or GitHub::

    $ pip install -e git+https://github.com/jsocol/pystatsd#egg=statsd

Or from source::

    $ git clone https://github.com/jsocol/pystatsd
    $ cd pystatsd
    $ python setup.py install


Docs
====

There are lots of docs in the ``docs/`` directory and on ReadTheDocs_.


.. _statsd: https://github.com/etsy/statsd
.. _Graphite: https://graphite.readthedocs.io/
.. _ReadTheDocs: https://statsd.readthedocs.io/en/latest/index.html