[tor-commits] [arm/master] Drop accounting rate configurability

atagar at torproject.org atagar at torproject.org
Sun Sep 21 19:53:47 UTC 2014


commit b757deeffac1d8fb7f1a3bb2a0f1d1f2d0849f2d
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Sep 21 12:38:45 2014 -0700

    Drop accounting rate configurability
    
    Config option probably nobody's ever set in the history of arm. Also bumping
    the rate since the only cost of doing so is a couple more GETINFO calls (Stem
    does a good job of caching the cacheable bits).
---
 arm/graphing/bandwidth_stats.py |   11 +++--------
 armrc.sample                    |    3 ---
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arm/graphing/bandwidth_stats.py b/arm/graphing/bandwidth_stats.py
index 8eb637d..e0947a4 100644
--- a/arm/graphing/bandwidth_stats.py
+++ b/arm/graphing/bandwidth_stats.py
@@ -14,19 +14,14 @@ from arm.util import bandwidth_from_state, tor_controller
 from stem.control import State
 from stem.util import conf, str_tools, system
 
-
-def conf_handler(key, value):
-  if key == 'features.graph.bw.accounting.rate':
-    return max(1, value)
-
+ACCOUNTING_RATE = 5
 
 CONFIG = conf.config_dict('arm', {
   'attr.hibernate_color': {},
   'features.graph.bw.transferInBytes': False,
   'features.graph.bw.accounting.show': True,
-  'features.graph.bw.accounting.rate': 10,
   'tor.chroot': '',
-}, conf_handler)
+})
 
 # width at which panel abandons placing optional stats (avg and total) with
 # header in favor of replacing the x-axis label
@@ -155,7 +150,7 @@ class BandwidthStats(graph_panel.GraphStats):
 
   def bandwidth_event(self, event):
     if self._accounting_stats and self.is_next_tick_redraw():
-      if time.time() - self._accounting_stats.retrieved >= CONFIG['features.graph.bw.accounting.rate']:
+      if time.time() - self._accounting_stats.retrieved >= ACCOUNTING_RATE:
         self._accounting_stats = tor_controller().get_accounting_stats(None)
 
     # scales units from B to KB for graphing
diff --git a/armrc.sample b/armrc.sample
index eb28daa..33a611d 100644
--- a/armrc.sample
+++ b/armrc.sample
@@ -178,13 +178,10 @@ features.graph.showIntermediateBounds true
 #   shows rate measurments in bytes if true, bits otherwise
 # accounting.show
 #   provides accounting stats if AccountingMax was set
-# accounting.rate
-#   seconds between querying accounting stats
 
 features.graph.bw.prepopulate true
 features.graph.bw.transferInBytes false
 features.graph.bw.accounting.show true
-features.graph.bw.accounting.rate 10
 
 # Parameters for connection display
 # ---------------------------------





More information about the tor-commits mailing list