MCPcopy
hub / github.com/benoitc/gunicorn / _sock_send

Method _sock_send

gunicorn/instrument/statsd.py:128–140  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

126 self._sock_send("{0}{1}:{2}|h".format(self.prefix, name, value))
127
128 def _sock_send(self, msg):
129 try:
130 if isinstance(msg, str):
131 msg = msg.encode("ascii")
132
133 # http://docs.datadoghq.com/guides/dogstatsd/#datagram-format
134 if self.dogstatsd_tags:
135 msg = msg + b"|#" + self.dogstatsd_tags.encode('ascii')
136
137 if self.sock:
138 self.sock.send(msg)
139 except Exception:
140 Logger.warning(self, "Error sending message to statsd", exc_info=True)

Callers 5

gaugeMethod · 0.95
incrementMethod · 0.95
decrementMethod · 0.95
timerMethod · 0.95
histogramMethod · 0.95

Calls 3

encodeMethod · 0.80
sendMethod · 0.45
warningMethod · 0.45

Tested by

no test coverage detected