parent
712208e5bf
commit
027d38b2c2
1 changed files with 5 additions and 5 deletions
|
@ -8,9 +8,9 @@ import Control.Concurrent
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
import Data.List
|
import Data.List
|
||||||
import Data.Time.Clock.POSIX (getPOSIXTime)
|
import Data.Time.Clock.POSIX (getPOSIXTime)
|
||||||
import qualified System.Remote.Event as Event
|
import qualified System.Metrics.Distribution as Distribution
|
||||||
import qualified System.Remote.Counter as Counter
|
import qualified System.Metrics.Counter as Counter
|
||||||
import qualified System.Remote.Label as Label
|
import qualified System.Metrics.Label as Label
|
||||||
import System.Remote.Monitoring
|
import System.Remote.Monitoring
|
||||||
|
|
||||||
-- 'sum' is using a non-strict lazy fold and will blow the stack.
|
-- 'sum' is using a non-strict lazy fold and will blow the stack.
|
||||||
|
@ -25,11 +25,11 @@ main = do
|
||||||
handle <- forkServer "localhost" 8000
|
handle <- forkServer "localhost" 8000
|
||||||
counter <- getCounter "iterations" handle
|
counter <- getCounter "iterations" handle
|
||||||
label <- getLabel "args" handle
|
label <- getLabel "args" handle
|
||||||
event <- getEvent "runtime" handle
|
event <- getDistribution "runtime" handle
|
||||||
Label.set label "some text string"
|
Label.set label "some text string"
|
||||||
let loop n = do
|
let loop n = do
|
||||||
t <- timed $ evaluate $ mean [1..n]
|
t <- timed $ evaluate $ mean [1..n]
|
||||||
Event.add event t
|
Distribution.add event t
|
||||||
threadDelay 2000
|
threadDelay 2000
|
||||||
Counter.inc counter
|
Counter.inc counter
|
||||||
loop n
|
loop n
|
||||||
|
|
Loading…
Reference in a new issue