[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [arm/master] Dropping the features.graph.showIntermediateBounds config option



commit 2ae6bf7ca1b6d4d2b2d849093372dd9b4bf731e2
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Nov 16 11:03:30 2014 -0800

    Dropping the features.graph.showIntermediateBounds config option
    
    I've *never* known someone that wanted this. Hell, I don't even remember why I
    added it except that I was overzealous about making *everything*
    configurable. :P
---
 arm/graph_panel.py |   31 ++++++++++++++++---------------
 armrc.sample       |    3 ---
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/arm/graph_panel.py b/arm/graph_panel.py
index b534f29..3dfefbe 100644
--- a/arm/graph_panel.py
+++ b/arm/graph_panel.py
@@ -76,7 +76,6 @@ CONFIG = conf.config_dict('arm', {
   'features.graph.interval': Interval.EACH_SECOND,
   'features.graph.bound': Bounds.LOCAL_MAX,
   'features.graph.max_width': 150,
-  'features.graph.showIntermediateBounds': True,
   'features.panels.show.connection': True,
   'features.graph.bw.prepopulate': True,
   'features.graph.bw.transferInBytes': False,
@@ -624,6 +623,9 @@ class GraphPanel(panel.Panel):
 
     # displays upper and lower bounds
 
+    # TODO: we need to get the longest y_axis_label() result so we can offset
+    # following content by that
+
     self.addstr(2, 0, param.y_axis_label(primary_max_bound, True), PRIMARY_COLOR)
     self.addstr(self._graph_height + 1, 0, param.y_axis_label(primary_min_bound, True), PRIMARY_COLOR)
 
@@ -632,26 +634,25 @@ class GraphPanel(panel.Panel):
 
     # displays intermediate bounds on every other row
 
-    if CONFIG['features.graph.showIntermediateBounds']:
-      ticks = (self._graph_height - 3) / 2
+    ticks = (self._graph_height - 3) / 2
 
-      for i in range(ticks):
-        row = self._graph_height - (2 * i) - 3
+    for i in range(ticks):
+      row = self._graph_height - (2 * i) - 3
 
-        if self._graph_height % 2 == 0 and i >= (ticks / 2):
-          row -= 1
+      if self._graph_height % 2 == 0 and i >= (ticks / 2):
+        row -= 1
 
-        if primary_min_bound != primary_max_bound:
-          primary_val = (primary_max_bound - primary_min_bound) * (self._graph_height - row - 1) / (self._graph_height - 1)
+      if primary_min_bound != primary_max_bound:
+        primary_val = (primary_max_bound - primary_min_bound) * (self._graph_height - row - 1) / (self._graph_height - 1)
 
-          if primary_val not in (primary_min_bound, primary_max_bound):
-            self.addstr(row + 2, 0, param.y_axis_label(primary_val, True), PRIMARY_COLOR)
+        if primary_val not in (primary_min_bound, primary_max_bound):
+          self.addstr(row + 2, 0, param.y_axis_label(primary_val, True), PRIMARY_COLOR)
 
-        if secondary_min_bound != secondary_max_bound:
-          secondary_val = (secondary_max_bound - secondary_min_bound) * (self._graph_height - row - 1) / (self._graph_height - 1)
+      if secondary_min_bound != secondary_max_bound:
+        secondary_val = (secondary_max_bound - secondary_min_bound) * (self._graph_height - row - 1) / (self._graph_height - 1)
 
-          if secondary_val not in (secondary_min_bound, secondary_max_bound):
-            self.addstr(row + 2, graph_column + 5, param.y_axis_label(secondary_val, False), SECONDARY_COLOR)
+        if secondary_val not in (secondary_min_bound, secondary_max_bound):
+          self.addstr(row + 2, graph_column + 5, param.y_axis_label(secondary_val, False), SECONDARY_COLOR)
 
     # creates bar graph (both primary and secondary)
 
diff --git a/armrc.sample b/armrc.sample
index 3dbc7de..ac65591 100644
--- a/armrc.sample
+++ b/armrc.sample
@@ -161,15 +161,12 @@ features.config.descriptions.persist true
 #   tight - local maximum and minimum
 # type
 #   none, bandwidth, connections, resources
-# showIntermediateBounds
-#   shows y-axis increments between the top/bottom bounds
 
 features.graph.height 7
 features.graph.maxWidth 150
 features.graph.interval each second
 features.graph.bound local_max
 features.graph.type bandwidth
-features.graph.showIntermediateBounds true
 
 # Parameters for graphing bandwidth stats
 # ---------------------------------------



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits