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

caduceus
  • 295
  • 2
  • 7
  • 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 http://nethogs.sourceforge.net/, I think it does what you want. – Diego Woitasen Oct 25 '13 at 12:18

2 Answers2

21

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

Phrogz
  • 533
  • 6
  • 18
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.

Dave Car
  • 11
  • 1