From 384659364b78a5b763aa07e29e767073d303c6e7 Mon Sep 17 00:00:00 2001 From: Jose A Ortega Ruiz Date: Sat, 20 Mar 2010 03:08:48 +0100 Subject: Bars for DiskIO Ignore-this: 50ae0b5d07377a8563acdede4dba31cf darcs-hash:20100320020848-748be-4c1b8f64b056f026328348a3eb8ca6f367544285.gz --- Plugins/Monitors/Common.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Plugins/Monitors/Common.hs') diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index 13f6323..9362fd8 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -41,6 +41,7 @@ module Plugins.Monitors.Common ( , showWithColors' , showPercentsWithColors , showPercentBar + , showLogBar , showWithUnits , takeDigits , showDigits @@ -394,6 +395,12 @@ showPercentBar v x = do s <- colorizeString v (take len $ cycle bf) return $ s ++ (take (bw - len) $ cycle bb) +showLogBar :: Float -> Float -> Monitor String +showLogBar f v = do + h <- fromIntegral `fmap` getConfigValue high + bw <- fromIntegral `fmap` getConfigValue barWidth + showPercentBar v $ f + (logBase 10 (v / h)) / bw + -- $threads doActionTwiceWithDelay :: Int -> IO [a] -> IO ([a], [a]) -- cgit v1.2.3