Skip to content

Instantly share code, notes, and snippets.

@corenting
Created July 8, 2019 13:08
Show Gist options
  • Select an option

  • Save corenting/edbc0110621bd1331d4e49698b6ed25f to your computer and use it in GitHub Desktop.

Select an option

Save corenting/edbc0110621bd1331d4e49698b6ed25f to your computer and use it in GitHub Desktop.

Revisions

  1. corenting created this gist Jul 8, 2019.
    17 changes: 17 additions & 0 deletions statsd_debug.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/usr/bin/env python3
    # encoding: utf-8

    import datetime
    import socket


    UDP_IP = "127.0.0.1"
    UDP_PORT = 8125


    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sock.bind((UDP_IP, UDP_PORT))

    while True:
    data, addr = sock.recvfrom(1024)
    print(datetime.datetime.now(), data)