Skip to content

Instantly share code, notes, and snippets.

View benhoskings's full-sized avatar

Ben Hoskings benhoskings

View GitHub Profile
@toolmantim
toolmantim / socket_stats_logger
Created June 16, 2015 07:18
How to monitor Unicorn and Puma unix socket queues with statsd
#!/bin/bash
# Logs the queued and active stats from the application's sockets and posts to statsd
while true; do
proc_lines=`cat /proc/net/unix`
for file in /home/deploy/myapp/tmp/sockets/*.sock; do
# /proc/net/unix lines are of the format: