bandwhich icon indicating copy to clipboard operation
bandwhich copied to clipboard

Recording bandwith usage over a time period and showing it using a graph

Open kaushalyap opened this issue 5 years ago • 6 comments

I am making a feature request here. I would like see bandwich allowing users to record their bandwidth usage over a period of time and showing it using a graph. ex: https://github.com/codebox/bitmeteros

  1. For graphing we can use https://github.com/fdehau/tui-rs
  2. In order to record bandwidth utilization overtime we have output bandwidth utilization to disk in aggregated fashion.

kaushalyap avatar Apr 01 '20 13:04 kaushalyap

Hey @kaushalyap - thanks for your suggestion! bandwhich already uses tui-rs to render its UI. We currently have a PR in the works to display cumulative bandwidth: https://github.com/imsnif/bandwhich/pull/155

About displaying it in a graph: I feel this might be beyond the capabilities I'd like bandwhich to have. But maybe this is something that can be implemented on top of bandwhich, either requiring it as a library or using raw_mode and piping it somewhere else?

imsnif avatar Apr 01 '20 16:04 imsnif

understandable if you output the stats to db another project can pick things up ex: https://codebox.net/pages/bitmeteros-bmclient-man

kaushalyap avatar Apr 02 '20 02:04 kaushalyap

Sure - that can be done with raw_mode, right? bandwhich --raw | something-that-parses-output-and-writes-to-db

imsnif avatar Apr 02 '20 08:04 imsnif

Having a flag to aggregate results(for a specific period(day, month), by process) is pretty useful, otherwise someone have to recalculate the aggregated bandwidth consumption from --raw


Another issue : I am sometimes seeing <UNKNOWN> for process name, why is that?

kaushalyap avatar Apr 02 '20 10:04 kaushalyap

How would you suggest such a flag should work?

re: <UNKNOWN>, see this: https://github.com/imsnif/bandwhich/issues/149

imsnif avatar Apr 02 '20 11:04 imsnif

Seems we have to get https://github.com/imsnif/bandwhich/pull/155 done, and we may able to extend things from there.

Anyway I am suggesting some flags like below

  • t : aggregated result for the hour
  • d : aggregated result for the day
  • m : aggregated result for the month
  • g : aggregate results by process names

so using something like

  • sudo bandwhich -dr -i iName will keep outputting aggregated results for the day
  • sudo bandwhich -dgr -i iName will keep outputting aggregated results grouped by process name for the day

And raw output format should contain timestamp in order for other tools parse the output and produce graphs.

kaushalyap avatar Apr 02 '20 15:04 kaushalyap