napkin-cli-2.0.0
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageGHC2024

Napkin.Spec.CliReporterDAG

Description

 
Synopsis

Documentation

type Success = Bool #

data UIName #

Unique names for user interface elements necessary for brick.

Instances

Instances details
Show UIName # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

Eq UIName # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

Methods

(==) :: UIName -> UIName -> Bool #

(/=) :: UIName -> UIName -> Bool #

Ord UIName # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

data PreviousStates #

Instances

Instances details
Default PreviousStates # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

Methods

def :: PreviousStates #

Generic PreviousStates # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

Associated Types

type Rep PreviousStates 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep PreviousStates = D1 ('MetaData "PreviousStates" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "PreviousStates" 'PrefixI 'True) (S1 ('MetaSel ('Just "procTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime)) :*: (S1 ('MetaSel ('Just "finishedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime)) :*: S1 ('MetaSel ('Just "blockedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime)))))
type Rep PreviousStates # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep PreviousStates = D1 ('MetaData "PreviousStates" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "PreviousStates" 'PrefixI 'True) (S1 ('MetaSel ('Just "procTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime)) :*: (S1 ('MetaSel ('Just "finishedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime)) :*: S1 ('MetaSel ('Just "blockedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NominalDiffTime)))))

data StateInfo (bk :: k) #

Instances

Instances details
Generic (StateInfo bk) # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

Associated Types

type Rep (StateInfo bk) 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep (StateInfo bk) = D1 ('MetaData "StateInfo" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "StateInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TaskState bk)) :*: S1 ('MetaSel ('Just "specName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "dbName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "taskType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TaskType) :*: S1 ('MetaSel ('Just "previousStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PreviousStates)))))

Methods

from :: StateInfo bk -> Rep (StateInfo bk) x #

to :: Rep (StateInfo bk) x -> StateInfo bk #

type Rep (StateInfo bk) # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep (StateInfo bk) = D1 ('MetaData "StateInfo" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "StateInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TaskState bk)) :*: S1 ('MetaSel ('Just "specName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "dbName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "taskType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TaskType) :*: S1 ('MetaSel ('Just "previousStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PreviousStates)))))

type States (bk :: k) = Map TaskId (StateInfo bk) #

data DrawState (bk :: k) #

Instances

Instances details
Generic (DrawState bk) # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

Associated Types

type Rep (DrawState bk) 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep (DrawState bk) = D1 ('MetaData "DrawState" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "DrawState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "startTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "showPostProcessedTableRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "taskStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (States bk)))) :*: ((S1 ('MetaSel ('Just "elapsedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Just "processingTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime)) :*: (S1 ('MetaSel ('Just "runDone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "wantsToQuit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "quit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "paused") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "estimatedTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Estimate))) :*: ((S1 ('MetaSel ('Just "totalStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QueryStats bk)) :*: S1 ('MetaSel ('Just "showError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "specListView") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SpecListView bk)) :*: S1 ('MetaSel ('Just "now") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime))))))

Methods

from :: DrawState bk -> Rep (DrawState bk) x #

to :: Rep (DrawState bk) x -> DrawState bk #

type Rep (DrawState bk) # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep (DrawState bk) = D1 ('MetaData "DrawState" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "DrawState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "startTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "showPostProcessedTableRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "taskStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (States bk)))) :*: ((S1 ('MetaSel ('Just "elapsedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Just "processingTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime)) :*: (S1 ('MetaSel ('Just "runDone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "wantsToQuit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "quit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "paused") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "estimatedTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Estimate))) :*: ((S1 ('MetaSel ('Just "totalStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QueryStats bk)) :*: S1 ('MetaSel ('Just "showError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "specListView") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SpecListView bk)) :*: S1 ('MetaSel ('Just "now") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime))))))

type SpecListView (bk :: k) = List UIName (StateLine bk) #

data UpdateEvent (b :: k) #

cliReporter :: forall {k} (b :: k) bk. HasBackendQueryStats b => (SpecTableName -> Ref Table) -> TasksDAG Full bk -> TMVar UIExecutionControl -> RuntimeEventQueueDAG b -> IO Success #

Pump the runtime event queue to display Spec execution progress in the terminal. Returns after all Specs are completed.

success :: forall {k} (b :: k). DrawState b -> Success #

printFinalReport :: forall {k} (b :: k). HasBackendQueryStats b => DrawState b -> IO () #

filterByState :: forall {k} (bk :: k). (TaskState bk -> Bool) -> States bk -> States bk #

infoState :: forall {k} (bk :: k). HasBackendQueryStats bk => States bk -> Bool -> TaskState bk -> Maybe Text #

drawScreen :: forall {k} (bk :: k). HasBackendQueryStats bk => DrawState bk -> [Widget UIName] #

data StateLine (bk :: k) #

Instances

Instances details
Generic (StateLine bk) # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

Associated Types

type Rep (StateLine bk) 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep (StateLine bk) = D1 ('MetaData "StateLine" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "StateLine" 'PrefixI 'True) ((S1 ('MetaSel ('Just "specName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "dbName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "_type") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TaskState bk)) :*: S1 ('MetaSel ('Just "previousStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PreviousStates)))))

Methods

from :: StateLine bk -> Rep (StateLine bk) x #

to :: Rep (StateLine bk) x -> StateLine bk #

type Rep (StateLine bk) # 
Instance details

Defined in Napkin.Spec.CliReporterDAG

type Rep (StateLine bk) = D1 ('MetaData "StateLine" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "StateLine" 'PrefixI 'True) ((S1 ('MetaSel ('Just "specName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "dbName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "_type") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TaskState bk)) :*: S1 ('MetaSel ('Just "previousStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PreviousStates)))))

sortedStatesList :: forall {k} (bk :: k). States bk -> [StateLine bk] #

renderOneState :: forall {k} (bk :: k). HasBackendQueryStats bk => NominalDiffTime -> Bool -> States bk -> Bool -> StateLine bk -> Widget UIName #