From 533d459b70774b3bbdab5dde1fcb442a579b36cc Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 11 Dec 2010 01:02:32 +0100 Subject: More sensitive logbars --- Plugins/Monitors/Common.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Plugins/Monitors/Common.hs') diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index a00cd48..90b2d28 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -408,8 +408,13 @@ showPercentBar v x = do showLogBar :: Float -> Float -> Monitor String showLogBar f v = do h <- fromIntegral `fmap` getConfigValue high + l <- fromIntegral `fmap` getConfigValue low bw <- fromIntegral `fmap` getConfigValue barWidth - showPercentBar v $ f + logBase 10 (v / h) / bw + let [ll, hh] = sort [l, h] + choose x | x == 0.0 = 0 + | x <= ll = 1 / bw + | otherwise = f + logBase 2 (x / hh) / bw + showPercentBar v $ choose v -- $threads -- cgit v1.2.3