I am trying to track the bandwidth usage of individual requests in ruby โโto find out how much of my network usage is shared between different API calls.
I canโt find anything in the net / http or ruby โโsocket classes (TCPSocket, etc.), which seem to have a decent way to do this with a lot of monkey fixes.
I found a number of useful linux tools for Linux, but none of them give me the granularity to check inside the HTTP requests in the headers (so that I can figure out which URL we are requesting). The tools I use are vnStat and ipfm - great system bandwidth or host / network monitoring.
Ideally, I would like to do something in the ruby โโcode to track the sent / received data. I think that if I could just get the original header and add this length to the length of the body for transmission and reception, it would be Good Enough โข.
source share