How to get download traffic

I want to count the download traffic, which part of the value I should get

Is anyone can help me?

ipfs stats bw will give you a rough estimate of the amount of bandwidth your node is using. For a more accurate estimate, you’ll have to ask your operating system.

I want to get the traffic for every download file, not the traffic for the entire node. I want to know if I can do this by modifying the source code,and if I can,which values need to be captured, thanks