Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
hg-misc-tools
Commits
c794f05a
Commit
c794f05a
authored
Mar 10, 2026
by
one
Browse files
[hytop] Reorder display columns to TX before RX
parent
a9bc082c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
projects/hytop/src/hytop/net/app.py
projects/hytop/src/hytop/net/app.py
+12
-12
No files found.
projects/hytop/src/hytop/net/app.py
View file @
c794f05a
...
@@ -81,10 +81,10 @@ class NetMonitorApp(App[int]):
...
@@ -81,10 +81,10 @@ class NetMonitorApp(App[int]):
(
"host"
,
"Host"
),
(
"host"
,
"Host"
),
(
"mode"
,
"Mode"
),
(
"mode"
,
"Mode"
),
(
"nic"
,
"NIC"
),
(
"nic"
,
"NIC"
),
(
"rx_bps"
,
"RX"
),
(
"tx_bps"
,
"TX"
),
(
"tx_bps"
,
"TX"
),
(
"rx_
avg
"
,
"RX
@window
"
),
(
"rx_
bps
"
,
"RX"
),
(
"tx_avg"
,
"TX@window"
),
(
"tx_avg"
,
"TX@window"
),
(
"rx_avg"
,
"RX@window"
),
]
]
def
__init__
(
def
__init__
(
...
@@ -115,10 +115,10 @@ class NetMonitorApp(App[int]):
...
@@ -115,10 +115,10 @@ class NetMonitorApp(App[int]):
"mode"
,
"mode"
,
"device"
,
"device"
,
"nic"
,
"nic"
,
"rx"
,
"tx"
,
"tx"
,
"rx
_avg
"
,
"rx"
,
"tx_avg"
,
"tx_avg"
,
"rx_avg"
,
]
]
self
.
_sort_mode
:
str
=
"grouped"
self
.
_sort_mode
:
str
=
"grouped"
self
.
_sort_desc
:
bool
=
False
self
.
_sort_desc
:
bool
=
False
...
@@ -142,10 +142,10 @@ class NetMonitorApp(App[int]):
...
@@ -142,10 +142,10 @@ class NetMonitorApp(App[int]):
table
.
add_column
(
"Mode"
,
key
=
"mode"
)
table
.
add_column
(
"Mode"
,
key
=
"mode"
)
table
.
add_column
(
"Device"
,
key
=
"device"
)
table
.
add_column
(
"Device"
,
key
=
"device"
)
table
.
add_column
(
"NIC"
,
key
=
"nic"
)
table
.
add_column
(
"NIC"
,
key
=
"nic"
)
table
.
add_column
(
"RX"
,
key
=
"rx"
)
table
.
add_column
(
"TX"
,
key
=
"tx"
)
table
.
add_column
(
"TX"
,
key
=
"tx"
)
table
.
add_column
(
f
"RX
@
{
fmt_window
(
self
.
_window
)
}
"
,
key
=
"rx
_avg
"
)
table
.
add_column
(
"RX"
,
key
=
"rx"
)
table
.
add_column
(
f
"TX@
{
fmt_window
(
self
.
_window
)
}
"
,
key
=
"tx_avg"
)
table
.
add_column
(
f
"TX@
{
fmt_window
(
self
.
_window
)
}
"
,
key
=
"tx_avg"
)
table
.
add_column
(
f
"RX@
{
fmt_window
(
self
.
_window
)
}
"
,
key
=
"rx_avg"
)
render_interval
=
min
(
self
.
_interval
,
0.5
)
render_interval
=
min
(
self
.
_interval
,
0.5
)
self
.
set_interval
(
render_interval
,
self
.
_tick
)
self
.
set_interval
(
render_interval
,
self
.
_tick
)
...
@@ -226,14 +226,14 @@ class NetMonitorApp(App[int]):
...
@@ -226,14 +226,14 @@ class NetMonitorApp(App[int]):
latest_rate
=
history
.
latest
()
latest_rate
=
history
.
latest
()
if
latest_rate
is
None
:
if
latest_rate
is
None
:
return
None
return
None
if
field
==
"rx_bps"
:
return
latest_rate
.
rx_bps
if
field
==
"tx_bps"
:
if
field
==
"tx_bps"
:
return
latest_rate
.
tx_bps
return
latest_rate
.
tx_bps
if
field
==
"rx_
avg
"
:
if
field
==
"rx_
bps
"
:
return
history
.
avg
(
"rx_bps"
,
self
.
_window
,
now
)
return
latest_rate
.
rx_bps
if
field
==
"tx_avg"
:
if
field
==
"tx_avg"
:
return
history
.
avg
(
"tx_bps"
,
self
.
_window
,
now
)
return
history
.
avg
(
"tx_bps"
,
self
.
_window
,
now
)
if
field
==
"rx_avg"
:
return
history
.
avg
(
"rx_bps"
,
self
.
_window
,
now
)
return
None
return
None
key_list
=
sort_with_missing_last
(
key_list
,
_metric_value
,
self
.
_sort_desc
)
key_list
=
sort_with_missing_last
(
key_list
,
_metric_value
,
self
.
_sort_desc
)
...
@@ -273,10 +273,10 @@ class NetMonitorApp(App[int]):
...
@@ -273,10 +273,10 @@ class NetMonitorApp(App[int]):
mode
,
mode
,
device_text
,
device_text
,
nic_text
,
nic_text
,
format_rate
(
latest_rate
.
rx_bps
,
self
.
_iec
),
format_rate
(
latest_rate
.
tx_bps
,
self
.
_iec
),
format_rate
(
latest_rate
.
tx_bps
,
self
.
_iec
),
format_rate
(
rx_avg
,
self
.
_iec
),
format_rate
(
latest_rate
.
rx_bps
,
self
.
_iec
),
format_rate
(
tx_avg
,
self
.
_iec
),
format_rate
(
tx_avg
,
self
.
_iec
),
format_rate
(
rx_avg
,
self
.
_iec
),
]
]
if
keys_to_display
==
self
.
_ordered_keys
:
if
keys_to_display
==
self
.
_ordered_keys
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment