network usage broken when recvbytes is 8 digits or longer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
byobu |
Fix Released
|
Low
|
Unassigned |
Bug Description
I noticed my network usage status disappeared recently, tracked it down to the way /proc/net/dev is parsed.
Test data:
lo:907096306 125825857 0 0 0 0 0 0 907096306 125825857 0 0 0 0 0 0
eth1:858630703 130597790 0 0 0 0 0 31982 1819919816 140249010 0 0 0 0 0 0
eth0:1661706230 120880636 0 0 0 0 0 0 203288241 59658728 0 0 1 0 0 0
The current code that reads in a loop into variables is caught out by the lack of space to separate the interface and the first number (receive bytes). I've had a go at fixing it using grep, cut and awk instead. Also updated ec2_cost to match (but don't have any way to test) and removed the unused OIFS and tx1 variables in network, hope that's alright.
Changed in byobu: | |
status: | In Progress → Fix Committed |
Changed in byobu: | |
status: | Fix Committed → Fix Released |
Thanks for the patch.
We don't want to use grep/awk/sed here, as those shell outs are very expensive. We recently moved all of this code from using grep/awk/sed to native shell code and saw some nice performance improvements.
I'll have to find another way around.