Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Clean up.

  • Loading branch information...
commit 8a212b18b4957a802f87c146bd05b0a372da492b 1 parent 8a6fb6c
James Socol authored

Showing 2 changed files with 3 additions and 4 deletions. Show diff stats Hide diff stats

  1. +3 3 statsd/client.py
  2. +0 1  statsd/tests.py
6 statsd/client.py
@@ -38,7 +38,7 @@ def __init__(self, host='localhost', port=8125, prefix=None):
38 38 # Use getaddrinfo to support IPv4/6.
39 39 self._addr = socket.getaddrinfo(host, port)[0][4]
40 40 self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
41   - self.prefix = prefix
  41 + self._prefix = prefix
42 42
43 43 def timer(self, stat, rate=1):
44 44 return _Timer(self, stat, rate)
@@ -67,8 +67,8 @@ def _send(self, stat, value, rate=1):
67 67 else:
68 68 return
69 69
70   - if self.prefix:
71   - stat = '%s.%s' % (self.prefix, stat)
  70 + if self._prefix:
  71 + stat = '%s.%s' % (self._prefix, stat)
72 72
73 73 try:
74 74 self._sock.sendto('%s:%s' % (stat, value), self._addr)
1  statsd/tests.py
@@ -12,7 +12,6 @@
12 12 ADDR = socket.getaddrinfo(*IN_ADDR)[0][4]
13 13
14 14
15   -
16 15 def _client(prefix=None):
17 16 sc = StatsClient(host=ADDR[0], port=ADDR[1], prefix=prefix)
18 17 sc._sock = mock.Mock()

0 comments on commit 8a212b1

Please sign in to comment.
Something went wrong with that request. Please try again.