| Stability | experimental |
|---|---|
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
GHC.Eventlog.Live.Machine.Analysis.Thread
Description
Synopsis
- data ThreadLabel = ThreadLabel {
- thread :: !ThreadId
- threadlabel :: !Text
- startTimeUnixNano :: !Timestamp
- processThreadLabels :: Process (WithStartTime Event) ThreadLabel
- data ThreadState
- showThreadStateCategory :: ThreadState -> Text
- threadStateStatus :: ThreadState -> Maybe ThreadStopStatus
- threadStateCap :: ThreadState -> Maybe Int
- data ThreadStateSpan = ThreadStateSpan {}
- processThreadStateSpans :: forall (m :: Type -> Type). MonadIO m => Verbosity -> ProcessT m (WithStartTime Event) ThreadStateSpan
- processThreadStateSpans' :: forall (m :: Type -> Type) s t. MonadIO m => (s -> Maybe Timestamp) -> (s -> Event) -> (s -> ThreadStateSpan -> t) -> Verbosity -> ProcessT m s t
Thread Analysis
Thread Labels
data ThreadLabel Source #
The ThreadLabel type represents the association of a label with a thread
starting at a given time.
Constructors
| ThreadLabel | |
Fields
| |
processThreadLabels :: Process (WithStartTime Event) ThreadLabel Source #
This machine processes ThreadLabel events and yields ThreadLabel values.
Thread State Spans
data ThreadState Source #
The execution states of a mutator thread.
Instances
| Show ThreadState Source # | |
Defined in GHC.Eventlog.Live.Machine.Analysis.Thread Methods showsPrec :: Int -> ThreadState -> ShowS # show :: ThreadState -> String # showList :: [ThreadState] -> ShowS # | |
threadStateStatus :: ThreadState -> Maybe ThreadStopStatus Source #
Get the ThreadState status, if the ThreadState is Blocked.
threadStateCap :: ThreadState -> Maybe Int Source #
Get the ThreadState capability, if the ThreadState is Running.
data ThreadStateSpan Source #
A span representing the state of a mutator thread.
Constructors
| ThreadStateSpan | |
Fields
| |
Instances
| Show ThreadStateSpan Source # | |
Defined in GHC.Eventlog.Live.Machine.Analysis.Thread Methods showsPrec :: Int -> ThreadStateSpan -> ShowS # show :: ThreadStateSpan -> String # showList :: [ThreadStateSpan] -> ShowS # | |
processThreadStateSpans :: forall (m :: Type -> Type). MonadIO m => Verbosity -> ProcessT m (WithStartTime Event) ThreadStateSpan Source #
This machine processes RunThread and StopThread events to produce
tThreadStateSpan values that represent segments of time where a thread is
running, blocked, or finished.
This processor uses the following finite-state automaton:
┌─(StopThread)─┐
│ ↓
┌→[ Blocked ]─┐
│ │
(StopThread) (RunThread)
│ │
└─[ Running ]←┘
↑ │
└─(RunThread)──┘
The transitions from Blocked to Blocked, Blocked to Running, and
Running to Running yield a ThreadStateSpan. There are additional
transitions (not pictured) from either state to the final Finished state
with a StopThread event with the ThreadFinished status.
processThreadStateSpans' :: forall (m :: Type -> Type) s t. MonadIO m => (s -> Maybe Timestamp) -> (s -> Event) -> (s -> ThreadStateSpan -> t) -> Verbosity -> ProcessT m s t Source #
Generalised version of processThreadStateSpans that can be adapted to work
on arbitrary types using a getter and a lens.