File: django.py

package info (click to toggle)
python-statsd 4.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 240 kB
  • sloc: python: 912; makefile: 127
file content (16 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from django.conf import settings

from statsd import defaults
from statsd.client import StatsClient


statsd = None

if statsd is None:
    host = getattr(settings, 'STATSD_HOST', defaults.HOST)
    port = getattr(settings, 'STATSD_PORT', defaults.PORT)
    prefix = getattr(settings, 'STATSD_PREFIX', defaults.PREFIX)
    maxudpsize = getattr(settings, 'STATSD_MAXUDPSIZE', defaults.MAXUDPSIZE)
    ipv6 = getattr(settings, 'STATSD_IPV6', defaults.IPV6)
    statsd = StatsClient(host=host, port=port, prefix=prefix,
                         maxudpsize=maxudpsize, ipv6=ipv6)