Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add network interface filter #279

Closed
aofei opened this issue Oct 29, 2020 · 1 comment · Fixed by #381
Closed

Feature request: Add network interface filter #279

aofei opened this issue Oct 29, 2020 · 1 comment · Fixed by #381
Labels
feature Requests for a new feature.

Comments

@aofei
Copy link

aofei commented Oct 29, 2020

Describe the feature request

Add a network_names (string slice, the default is empty, and empty means all) configuration item to specify the network interfaces that need to be calculated by btm.

Usage:

network_names = ["eth0", "eth1"]

Additional context/details

At present, btm takes all network interfaces into consideration in traffic calculation. Of course, there's nothing wrong with it. But we must admit that there're some flaws in doing so. For example, there may be some network interfaces that people want to ignore, such as those created by docker. So it seems reasonable to add a network interface filter.

let networks = sys.get_networks();
for (_, network) in networks {
total_rx += network.get_total_received();
total_tx += network.get_total_transmitted();
}

@aofei aofei added the feature Requests for a new feature. label Oct 29, 2020
@ClementTsang
Copy link
Owner

Yep, that sounds good. I plan on eventually allowing the ability to display per interface so this would tie nicely into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Requests for a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants