[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [arm/master] More prompt redrawing of the graph
commit ae079d9281478e23486c3868974585bd92543ba8
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sun Nov 16 10:59:12 2014 -0800
More prompt redrawing of the graph
We redrew the graph at 'some point in its interval' rather than right away when
it had a new sampling to show. Fixing that.
---
arm/graph_panel.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arm/graph_panel.py b/arm/graph_panel.py
index 60006db..b534f29 100644
--- a/arm/graph_panel.py
+++ b/arm/graph_panel.py
@@ -362,7 +362,6 @@ class GraphPanel(panel.Panel):
self._graph_height = max(1, CONFIG['features.graph.height'])
self._accounting_stats = None
- self._last_redraw = 0
self._stats = {
GraphStat.BANDWIDTH: BandwidthStats(),
@@ -411,8 +410,9 @@ class GraphPanel(panel.Panel):
arm.controller.get_controller().redraw()
update_rate = INTERVAL_SECONDS[self._update_interval]
+ param = self.get_attr('_stats')[self._current_display]
- if time.time() - self._last_redraw > update_rate:
+ if param.primary.tick % update_rate == 0:
self.redraw(True)
def reset_listener(self, controller, event_type, _):
@@ -572,8 +572,6 @@ class GraphPanel(panel.Panel):
if not self._current_display:
return
- self._last_redraw = time.time()
-
param = self.get_attr('_stats')[self._current_display]
graph_column = min((width - 10) / 2, CONFIG['features.graph.max_width'])
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits