aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_defs.hrl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-12-10 12:39:19 +0100
committerDan Gudmundsson <[email protected]>2016-02-22 09:54:34 +0100
commitbde2d01506a6368b4d3667d0102c189832563654 (patch)
tree9d070f2d2a00e2d669bcac4fd03121ca0473d609 /lib/observer/src/observer_defs.hrl
parentd80e6353e7b827b9fb3d9a9505948dfaa2491cd4 (diff)
downloadotp-bde2d01506a6368b4d3667d0102c189832563654.tar.gz
otp-bde2d01506a6368b4d3667d0102c189832563654.tar.bz2
otp-bde2d01506a6368b4d3667d0102c189832563654.zip
observer: Optimize drawing of graphs
By allowing changes to the number of minutes displayed and update frequency, we need to optimize the drawing of the graphs as it can no longer recalculate everything in each frame drawn. Only recalculate the changed entries, takes more memory but far less cpu usage. While updating the gui, increase the frame-rate a bit so it updates smoother and decrease pen size for graphs to 1 pixel as it looks better according to an office voting.
Diffstat (limited to 'lib/observer/src/observer_defs.hrl')
-rw-r--r--lib/observer/src/observer_defs.hrl11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/observer/src/observer_defs.hrl b/lib/observer/src/observer_defs.hrl
index 1c2fe520b7..c4ba84a8c4 100644
--- a/lib/observer/src/observer_defs.hrl
+++ b/lib/observer/src/observer_defs.hrl
@@ -49,3 +49,14 @@
-define(LCTRL_WDECR, 4). %% Remove some pixels in column width to avoid creating unnecessary scrollbar
-define(SASH_STYLE, ?wxSP_LIVE_UPDATE bor ?wxSP_NOBORDER bor ?wxSP_3DSASH).
+
+-define(DISP_FREQ, 10). %% per second
+-define(FETCH_DATA, 2). %% per second
+-define(DISP_SECONDS, 60).
+
+-record(ti, {tick=0, disp=?DISP_FREQ/?FETCH_DATA, fetch=?FETCH_DATA, secs=?DISP_SECONDS}).
+
+-record(win, {name, panel, size, geom,
+ graphs=[], no_samples=0,
+ max, state,
+ info=[]}).