Repository navigation
fix(network): read the hide_threshold_bytes the plugin documents - #3726
Merged
nicolargo merged 1 commit intoSep 10, 2026
Merged
Conversation
Both the reference configuration and docs/aoa/network.rst offer the option
under [network]:
[network]
hide_zero=True
hide_threshold_bytes=0
but NetworkPlugin never read it, so it stayed at the base class default of
0 whatever the user wrote. diskio has read it since the option was added;
network was left out.
Nothing reports an option a plugin ignores: hide_zero keeps working, it
just never applies the threshold, so an interface carrying a trickle of
background traffic is shown when the user asked for it to be hidden.
Read it beside hide_zero, exactly as diskio does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
hide_threshold_bytesis offered to users under[network]in two places:conf/glances.confdocs/aoa/network.rstNetworkPlugin.__init__()never read it.diskiohas read it since the option was introduced;networkwas left out:So the attribute stayed at the base-class default of
0whatever the user wrote. Nothing reports it:hide_zerokeeps working, it simply never applies the threshold, and an interface carrying a trickle of background traffic is shown when the user asked for it to be hidden.The change
Read it beside
hide_zero, exactly as diskio does. Two lines, no new behaviour of its own.Tests
tests/test_network_hide_threshold.py, 5 tests. The wiring assertion alone would be weak, so the boundary is also read back out of the views dict: withhide_threshold_bytes=1024, an interface at 524 B/s stays hidden and one at 2048 B/s is revealed. The last test pins that the unconfigured default of0still reveals that same 524 B/s trickle, so this does not quietly change anyone's current behaviour.Mutation — delete the added
get_int_valueline: 2 fail, the wiring test and the "below the threshold stays hidden" behavioural test.tests/test_plugin_network.pyandtests/test_lazy_views.py— 45 passed.ruff checkandruff format --checkclean.Independent of #3725, which fixes the comparison this threshold is used in; either can go first.