From c23b38c3c8841e948e521bec47264c1423678eff Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Mon, 18 Jan 2010 02:07:02 +0100 Subject: MultiCpus: average only over two samples Ignore-this: bb8498323409ea15d452f46ab64f31cb darcs-hash:20100118010702-40885-37a31605605a9cbf534fac9f4c04bf017c813bf2.gz --- Plugins/Monitors/MultiCpu.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Plugins/Monitors/MultiCpu.hs b/Plugins/Monitors/MultiCpu.hs index c0fa21a..6bbcdd3 100644 --- a/Plugins/Monitors/MultiCpu.hs +++ b/Plugins/Monitors/MultiCpu.hs @@ -38,11 +38,12 @@ cpuParser = map parseList . cpuLists parseCpuData :: IO [[Float]] parseCpuData = - do (as, bs) <- doActionTwiceWithDelay 350000 cpuData + do (as, bs) <- doActionTwiceWithDelay 950000 cpuData let p0 = zipWith percent bs as - (as', bs') <- doActionTwiceWithDelay 350000 cpuData - let p1 = zipWith percent bs' as' - return $ zipWith (\x y -> zipWith (\a b -> (a + b) / 2.0) x y) p1 p0 + return p0 + -- (as', bs') <- doActionTwiceWithDelay 350000 cpuData + -- let p1 = zipWith percent bs' as' + -- return $ zipWith (\x y -> zipWith (\a b -> (a + b) / 2.0) x y) p1 p0 percent :: [Float] -> [Float] -> [Float] percent b a = if tot > 0 then map (/ tot) $ take 4 dif else [0, 0, 0, 0] -- cgit v1.2.3