Copyright | (c) 2017 Composewell Technologies |
---|---|
License | BSD-3-Clause |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- minThreadDelay :: NanoSecond64
- collectLatency :: Bool -> SVarStats -> YieldRateInfo -> Bool -> IO (Count, AbsTime, NanoSecond64)
- addThread :: MonadIO m => IORef (Set ThreadId) -> ThreadId -> m ()
- delThread :: MonadIO m => IORef (Set ThreadId) -> ThreadId -> m ()
- modifyThread :: MonadIO m => IORef (Set ThreadId) -> MVar () -> ThreadId -> m ()
- allThreadsDone :: MonadIO m => IORef (Set ThreadId) -> m Bool
- recordMaxWorkers :: MonadIO m => IORef Int -> SVarStats -> m ()
- dumpSVarStats :: Bool -> Maybe YieldRateInfo -> SVarStats -> IO String
Latency collection
minThreadDelay :: NanoSecond64 Source #
This is a magic number and it is overloaded, and used at several places to achieve batching:
- If we have to sleep to slowdown this is the minimum period that we accumulate before we sleep. Also, workers do not stop until this much sleep time is accumulated.
- Collected latencies are computed and transferred to measured latency after a minimum of this period.
collectLatency :: Bool -> SVarStats -> YieldRateInfo -> Bool -> IO (Count, AbsTime, NanoSecond64) Source #
Thread accounting
allThreadsDone :: MonadIO m => IORef (Set ThreadId) -> m Bool Source #
This is safe even if we are adding more threads concurrently because if
a child thread is adding another thread then anyway workerThreads
will
not be empty.
Diagnostics
dumpSVarStats :: Bool -> Maybe YieldRateInfo -> SVarStats -> IO String Source #