I was writing a script that converts ss(8) output to prometheus metrics. I ended up writing a class that `emit` method, and manually passing it as 1st argument throughout all the parser functions like a savage.
https://gist.github.com/Wolf480pl/55cab3b6ce0f09a4eb6bc387d58293ba