Recording bandwith usage over a time period and showing it using a graph
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
- For graphing we can use https://github.com/fdehau/tui-rs
- In order to record bandwidth utilization overtime we have output bandwidth utilization to disk in aggregated fashion.
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?
understandable if you output the stats to db another project can pick things up ex: https://codebox.net/pages/bitmeteros-bmclient-man
Sure - that can be done with raw_mode, right? bandwhich --raw | something-that-parses-output-and-writes-to-db
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?
How would you suggest such a flag should work?
re: <UNKNOWN>, see this: https://github.com/imsnif/bandwhich/issues/149
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 iNamewill keep outputting aggregated results for the daysudo bandwhich -dgr -i iNamewill 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.