MCPcopy
hub / github.com/statsd/statsd / send

Method send

examples/python_example.py:146–157  ·  view source on GitHub ↗

Sends key/value pairs via UDP. >>> StatsdClient.send({"example.send":"11|c"}, ("127.0.0.1", 8125))

(_dict, addr)

Source from the content-addressed store, hash-verified

144
145 @staticmethod
146 def send(_dict, addr):
147 """
148 Sends key/value pairs via UDP.
149
150 >>> StatsdClient.send({"example.send":"11|c"}, ("127.0.0.1", 8125))
151 """
152 # TODO(rbtz@): IPv6 support
153 # TODO(rbtz@): Creating socket on each send is a waste of resources
154 udp_sock = socket(AF_INET, SOCK_DGRAM)
155 # TODO(rbtz@): Add batch support
156 for item in _dict.items():
157 udp_sock.sendto(":".join(item).encode('utf-8'), addr)

Callers 14

update_statsMethod · 0.95
broadcastMsgFunction · 0.45
proxy.jsFile · 0.45
statsd_sendFunction · 0.45
statsd_sendFunction · 0.45
statsd_sendFunction · 0.45
statsd_sendFunction · 0.45
server_tests.jsFile · 0.45
statsd_sendFunction · 0.45
statsd_sendFunction · 0.45
statsd_sendFunction · 0.45
statsd_sendFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected