[tor-commits] [nyx/master] Bandwidth graph title units could disappear

atagar at torproject.org atagar at torproject.org
Thu Sep 14 01:10:13 UTC 2017


commit e22bfbcf86abe129bb64a8e83c602ef70d7700b4
Author: Damian Johnson <atagar at torproject.org>
Date:   Wed Sep 13 18:08:50 2017 -0700

    Bandwidth graph title units could disappear
    
    Truncation of '.0' from values had a bug where it made units disappear...
    
      Bandwidth (limit: 5/s, burst: 1/s, measured: 10.3 KB/s):
---
 nyx/panel/graph.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nyx/panel/graph.py b/nyx/panel/graph.py
index db0ec53..cec0a71 100644
--- a/nyx/panel/graph.py
+++ b/nyx/panel/graph.py
@@ -332,8 +332,8 @@ class BandwidthStats(GraphCategory):
       # if both are using rounded values then strip off the '.0' decimal
 
       if '.0' in bw_rate_label and '.0' in bw_burst_label:
-        bw_rate_label = bw_rate_label.split('.', 1)[0]
-        bw_burst_label = bw_burst_label.split('.', 1)[0]
+        bw_rate_label = bw_rate_label.replace('.0', '')
+        bw_burst_label = bw_burst_label.replace('.0', '')
 
       stats.append('limit: %s/s' % bw_rate_label)
       stats.append('burst: %s/s' % bw_burst_label)



More information about the tor-commits mailing list