packages feed

helics 0.5.0.1 → 0.5.1

raw patch · 3 files changed

+10/−12 lines, 3 filesdep ~base

Dependency ranges changed: base

Files

LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2014 HirotomoMoriwaki+Copyright (c) 2014-2015 HirotomoMoriwaki  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
helics.cabal view
@@ -1,5 +1,5 @@ name:                helics-version:             0.5.0.1+version:             0.5.1 synopsis:            New Relic® agent SDK wrapper for Haskell. description:            New Relic® agent SDK wrapper for Haskell.@@ -19,7 +19,7 @@ maintainer:          HirotomoMoriwaki<philopon.dependence@gmail.com> Homepage:            https://github.com/philopon/helics Bug-reports:         https://github.com/philopon/helics/issues-copyright:           (c) 2014 Hirotomo Moriwaki+copyright:           (c) 2014-2015 Hirotomo Moriwaki category:            Network stability:           experimental build-type:          Custom@@ -42,7 +42,7 @@                        Network.Helics.Internal.Types   ghc-options:         -Wall -O2   default-language:    Haskell2010-  build-depends:       base               >=4.6  && <4.8+  build-depends:       base               >=4.6  && <4.9                      , data-default-class >=0.0  && <0.1                      , bytestring         >=0.10 && <0.11 
src/Network/Helics/Sampler.hs view
@@ -6,8 +6,6 @@  import GHC.Conc -import Control.Applicative- import Network.Helics.Foreign.System  import Data.Time.Clock@@ -16,24 +14,24 @@  sampler :: Callback -> Int -> IO () sampler callback sleep = do-    t     <- fromIntegral <$> clockTick-    core  <- fromIntegral <$> getNumCapabilities+    t     <- fromIntegral `fmap` clockTick+    core  <- fromIntegral `fmap` getNumCapabilities     cTime <- getCurrentTime-    uTime <- fromIntegral <$> getUserTime-    pSize <- fromIntegral <$> pageSize+    uTime <- fromIntegral `fmap` getUserTime+    pSize <- fromIntegral `fmap` pageSize     pid   <- getProcessID     threadDelay sleep     go t core pSize pid cTime uTime   where      unCClock (CClock c) = c-    getUserTime = unCClock . userTime <$> getProcessTimes+    getUserTime = (unCClock . userTime) `fmap` getProcessTimes      go tick core pSize pid = loop       where         loop cTime uTime = do             cTime' <- getCurrentTime-            uTime' <- fromIntegral <$> getUserTime+            uTime' <- fromIntegral `fmap` getUserTime             pages  <- getPages pid             let real = realToFrac $ diffUTCTime cTime' cTime                 user = (uTime' - uTime) / tick