eventlog-live-0.3.0.0: Live processing of eventlog data.
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

GHC.Eventlog.Live.Machine.Analysis.Thread

Description

 
Synopsis

Thread Analysis

Thread Labels

data ThreadLabel Source #

The ThreadLabel type represents the association of a label with a thread starting at a given time.

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.

Constructors

Running 

Fields

Blocked 
Finished 

Instances

Instances details
Show ThreadState Source # 
Instance details

Defined in GHC.Eventlog.Live.Machine.Analysis.Thread

showThreadStateCategory :: ThreadState -> Text Source #

Pretty-print a thread state as Running, Blocked, or Finished.

data ThreadStateSpan Source #

A span representing the state of a mutator thread.

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.