16

I want to measure how much bandwidth git pull uses, preferably by prefixing git command with desired program, i.e. nettally git pull

Alternatively, is there some sneaky way to accumulate nethogs / wireshark data and add up the figures after execution?

Thanks

4
  • If i were to do this, I would run iftop but that's not totally suitable for your needs.
    – mveroone
    Oct 24 '13 at 13:31
  • yeah, you know all these programs do the same thing. nethogs, wireshark, iftop. Is it possible to run the app on it's own interface maybe?
    – caduceus
    Oct 24 '13 at 13:46
  • Another trick would be an iptables "mangle" rule maybe ? then you have counters... but that's still far from what you want.
    – mveroone
    Oct 24 '13 at 13:47
  • Have a look at nethogs.sourceforge.net, I think it does what you want. Oct 25 '13 at 12:18
20

If you launch nethogs and then press the m key, it will switch from instantaneous mode (kB/s) to cumulative mode (kB).

0

Wrap the command in a SOCKS client (eg. dante-client), point SOCKS at a server (eg. socat/netcat) which will measure traffic and forward to the real SOCKS server. There will be a SOCKS overhead, but presuming you don't need an exact measure then just factor this in.

A shell script could set up the socat sockets and LD_PRELOAD_PATH environment, run the command and report stats once done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.