module Simulation.Aivika.Trans.Server
(
Server,
newServer,
newStateServer,
newPreemptibleServer,
newPreemptibleStateServer,
serverProcessor,
serverInitState,
serverState,
serverTotalInputWaitTime,
serverTotalProcessingTime,
serverTotalOutputWaitTime,
serverTotalPreemptionTime,
serverInputWaitTime,
serverProcessingTime,
serverOutputWaitTime,
serverPreemptionTime,
serverInputWaitFactor,
serverProcessingFactor,
serverOutputWaitFactor,
serverPreemptionFactor,
resetServer,
serverSummary,
serverStateChanged,
serverStateChanged_,
serverTotalInputWaitTimeChanged,
serverTotalInputWaitTimeChanged_,
serverTotalProcessingTimeChanged,
serverTotalProcessingTimeChanged_,
serverTotalOutputWaitTimeChanged,
serverTotalOutputWaitTimeChanged_,
serverTotalPreemptionTimeChanged,
serverTotalPreemptionTimeChanged_,
serverInputWaitTimeChanged,
serverInputWaitTimeChanged_,
serverProcessingTimeChanged,
serverProcessingTimeChanged_,
serverOutputWaitTimeChanged,
serverOutputWaitTimeChanged_,
serverPreemptionTimeChanged,
serverPreemptionTimeChanged_,
serverInputWaitFactorChanged,
serverInputWaitFactorChanged_,
serverProcessingFactorChanged,
serverProcessingFactorChanged_,
serverOutputWaitFactorChanged,
serverOutputWaitFactorChanged_,
serverPreemptionFactorChanged,
serverPreemptionFactorChanged_,
serverInputReceived,
serverTaskPreemptionBeginning,
serverTaskPreemptionEnding,
serverTaskProcessed,
serverOutputProvided,
serverChanged_) where
import Data.Monoid
import Control.Monad
import Control.Arrow
import Simulation.Aivika.Trans.Ref.Base
import Simulation.Aivika.Trans.DES
import Simulation.Aivika.Trans.Parameter
import Simulation.Aivika.Trans.Simulation
import Simulation.Aivika.Trans.Dynamics
import Simulation.Aivika.Trans.Internal.Specs
import Simulation.Aivika.Trans.Internal.Event
import Simulation.Aivika.Trans.Signal
import Simulation.Aivika.Trans.Cont
import Simulation.Aivika.Trans.Process
import Simulation.Aivika.Trans.Processor
import Simulation.Aivika.Trans.Stream
import Simulation.Aivika.Trans.Statistics
data Server m s a b =
Server { forall (m :: * -> *) s a b. Server m s a b -> s
serverInitState :: s,
forall (m :: * -> *) s a b. Server m s a b -> Ref m s
serverStateRef :: Ref m s,
forall (m :: * -> *) s a b.
Server m s a b -> s -> a -> Process m (s, b)
serverProcess :: s -> a -> Process m (s, b),
forall (m :: * -> *) s a b. Server m s a b -> Bool
serverProcessPreemptible :: Bool,
forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef :: Ref m Double,
forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef :: Ref m Double,
forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef :: Ref m Double,
forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef :: Ref m Double,
forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverInputWaitTimeRef :: Ref m (SamplingStats Double),
forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverProcessingTimeRef :: Ref m (SamplingStats Double),
forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverOutputWaitTimeRef :: Ref m (SamplingStats Double),
forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverPreemptionTimeRef :: Ref m (SamplingStats Double),
forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverInputReceivedSource :: SignalSource m a,
forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverTaskPreemptionBeginningSource :: SignalSource m a,
forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverTaskPreemptionEndingSource :: SignalSource m a,
forall (m :: * -> *) s a b. Server m s a b -> SignalSource m (a, b)
serverTaskProcessedSource :: SignalSource m (a, b),
forall (m :: * -> *) s a b. Server m s a b -> SignalSource m (a, b)
serverOutputProvidedSource :: SignalSource m (a, b)
}
newServer :: MonadDES m
=> (a -> Process m b)
-> Simulation m (Server m () a b)
{-# INLINABLE newServer #-}
newServer :: forall (m :: * -> *) a b.
MonadDES m =>
(a -> Process m b) -> Simulation m (Server m () a b)
newServer = forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
False
newStateServer :: MonadDES m
=> (s -> a -> Process m (s, b))
-> s
-> Simulation m (Server m s a b)
{-# INLINABLE newStateServer #-}
newStateServer :: forall (m :: * -> *) s a b.
MonadDES m =>
(s -> a -> Process m (s, b)) -> s -> Simulation m (Server m s a b)
newStateServer = forall (m :: * -> *) s a b.
MonadDES m =>
Bool
-> (s -> a -> Process m (s, b))
-> s
-> Simulation m (Server m s a b)
newPreemptibleStateServer Bool
False
newPreemptibleServer :: MonadDES m
=> Bool
-> (a -> Process m b)
-> Simulation m (Server m () a b)
{-# INLINABLE newPreemptibleServer #-}
newPreemptibleServer :: forall (m :: * -> *) a b.
MonadDES m =>
Bool -> (a -> Process m b) -> Simulation m (Server m () a b)
newPreemptibleServer Bool
preemptible a -> Process m b
provide =
forall a b c. (a -> b -> c) -> b -> a -> c
flip (forall (m :: * -> *) s a b.
MonadDES m =>
Bool
-> (s -> a -> Process m (s, b))
-> s
-> Simulation m (Server m s a b)
newPreemptibleStateServer Bool
preemptible) () forall a b. (a -> b) -> a -> b
$ \()
s a
a ->
do b
b <- a -> Process m b
provide a
a
forall (m :: * -> *) a. Monad m => a -> m a
return (()
s, b
b)
newPreemptibleStateServer :: MonadDES m
=> Bool
-> (s -> a -> Process m (s, b))
-> s
-> Simulation m (Server m s a b)
{-# INLINABLE newPreemptibleStateServer #-}
newPreemptibleStateServer :: forall (m :: * -> *) s a b.
MonadDES m =>
Bool
-> (s -> a -> Process m (s, b))
-> s
-> Simulation m (Server m s a b)
newPreemptibleStateServer Bool
preemptible s -> a -> Process m (s, b)
provide s
state =
do Ref m s
r0 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef s
state
Ref m Double
r1 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef Double
0
Ref m Double
r2 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef Double
0
Ref m Double
r3 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef Double
0
Ref m Double
r4 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef Double
0
Ref m (SamplingStats Double)
r5 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef forall a. SamplingData a => SamplingStats a
emptySamplingStats
Ref m (SamplingStats Double)
r6 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef forall a. SamplingData a => SamplingStats a
emptySamplingStats
Ref m (SamplingStats Double)
r7 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef forall a. SamplingData a => SamplingStats a
emptySamplingStats
Ref m (SamplingStats Double)
r8 <- forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef forall a. SamplingData a => SamplingStats a
emptySamplingStats
SignalSource m a
s1 <- forall (m :: * -> *) a.
MonadDES m =>
Simulation m (SignalSource m a)
newSignalSource
SignalSource m a
s2 <- forall (m :: * -> *) a.
MonadDES m =>
Simulation m (SignalSource m a)
newSignalSource
SignalSource m a
s3 <- forall (m :: * -> *) a.
MonadDES m =>
Simulation m (SignalSource m a)
newSignalSource
SignalSource m (a, b)
s4 <- forall (m :: * -> *) a.
MonadDES m =>
Simulation m (SignalSource m a)
newSignalSource
SignalSource m (a, b)
s5 <- forall (m :: * -> *) a.
MonadDES m =>
Simulation m (SignalSource m a)
newSignalSource
let server :: Server m s a b
server = Server { serverInitState :: s
serverInitState = s
state,
serverStateRef :: Ref m s
serverStateRef = Ref m s
r0,
serverProcess :: s -> a -> Process m (s, b)
serverProcess = s -> a -> Process m (s, b)
provide,
serverProcessPreemptible :: Bool
serverProcessPreemptible = Bool
preemptible,
serverTotalInputWaitTimeRef :: Ref m Double
serverTotalInputWaitTimeRef = Ref m Double
r1,
serverTotalProcessingTimeRef :: Ref m Double
serverTotalProcessingTimeRef = Ref m Double
r2,
serverTotalOutputWaitTimeRef :: Ref m Double
serverTotalOutputWaitTimeRef = Ref m Double
r3,
serverTotalPreemptionTimeRef :: Ref m Double
serverTotalPreemptionTimeRef = Ref m Double
r4,
serverInputWaitTimeRef :: Ref m (SamplingStats Double)
serverInputWaitTimeRef = Ref m (SamplingStats Double)
r5,
serverProcessingTimeRef :: Ref m (SamplingStats Double)
serverProcessingTimeRef = Ref m (SamplingStats Double)
r6,
serverOutputWaitTimeRef :: Ref m (SamplingStats Double)
serverOutputWaitTimeRef = Ref m (SamplingStats Double)
r7,
serverPreemptionTimeRef :: Ref m (SamplingStats Double)
serverPreemptionTimeRef = Ref m (SamplingStats Double)
r8,
serverInputReceivedSource :: SignalSource m a
serverInputReceivedSource = SignalSource m a
s1,
serverTaskPreemptionBeginningSource :: SignalSource m a
serverTaskPreemptionBeginningSource = SignalSource m a
s2,
serverTaskPreemptionEndingSource :: SignalSource m a
serverTaskPreemptionEndingSource = SignalSource m a
s3,
serverTaskProcessedSource :: SignalSource m (a, b)
serverTaskProcessedSource = SignalSource m (a, b)
s4,
serverOutputProvidedSource :: SignalSource m (a, b)
serverOutputProvidedSource = SignalSource m (a, b)
s5 }
forall (m :: * -> *) a. Monad m => a -> m a
return Server m s a b
server
serverProcessor :: MonadDES m => Server m s a b -> Processor m a b
{-# INLINABLE serverProcessor #-}
serverProcessor :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Processor m a b
serverProcessor Server m s a b
server =
forall (m :: * -> *) a b.
(Stream m a -> Stream m b) -> Processor m a b
Processor forall a b. (a -> b) -> a -> b
$ \Stream m a
xs -> s -> Maybe (Double, a, b) -> Stream m a -> Stream m b
loop (forall (m :: * -> *) s a b. Server m s a b -> s
serverInitState Server m s a b
server) forall a. Maybe a
Nothing Stream m a
xs
where
loop :: s -> Maybe (Double, a, b) -> Stream m a -> Stream m b
loop s
s Maybe (Double, a, b)
r Stream m a
xs =
forall (m :: * -> *) a. Process m (a, Stream m a) -> Stream m a
Cons forall a b. (a -> b) -> a -> b
$
do Double
t0 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics forall (m :: * -> *). Monad m => Dynamics m Double
time
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
EventLift t m =>
Event m a -> t m a
liftEvent forall a b. (a -> b) -> a -> b
$
case Maybe (Double, a, b)
r of
Maybe (Double, a, b)
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return ()
Just (Double
t', a
a', b
b') ->
do forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server) (forall a. Num a => a -> a -> a
+ (Double
t0 forall a. Num a => a -> a -> a
- Double
t'))
forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverOutputWaitTimeRef Server m s a b
server) forall a b. (a -> b) -> a -> b
$
forall a. SamplingData a => a -> SamplingStats a -> SamplingStats a
addSamplingStats (Double
t0 forall a. Num a => a -> a -> a
- Double
t')
forall (m :: * -> *) a. SignalSource m a -> a -> Event m ()
triggerSignal (forall (m :: * -> *) s a b. Server m s a b -> SignalSource m (a, b)
serverOutputProvidedSource Server m s a b
server) (a
a', b
b')
(a
a, Stream m a
xs') <- forall (m :: * -> *) a. Stream m a -> Process m (a, Stream m a)
runStream Stream m a
xs
Double
t1 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics forall (m :: * -> *). Monad m => Dynamics m Double
time
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
EventLift t m =>
Event m a -> t m a
liftEvent forall a b. (a -> b) -> a -> b
$
do forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server) (forall a. Num a => a -> a -> a
+ (Double
t1 forall a. Num a => a -> a -> a
- Double
t0))
forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverInputWaitTimeRef Server m s a b
server) forall a b. (a -> b) -> a -> b
$
forall a. SamplingData a => a -> SamplingStats a -> SamplingStats a
addSamplingStats (Double
t1 forall a. Num a => a -> a -> a
- Double
t0)
forall (m :: * -> *) a. SignalSource m a -> a -> Event m ()
triggerSignal (forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverInputReceivedSource Server m s a b
server) a
a
(s
s', b
b, Double
dt) <-
if forall (m :: * -> *) s a b. Server m s a b -> Bool
serverProcessPreemptible Server m s a b
server
then forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> s -> a -> Process m (s, b, Double)
serverProcessPreempting Server m s a b
server s
s a
a
else do (s
s', b
b) <- forall (m :: * -> *) s a b.
Server m s a b -> s -> a -> Process m (s, b)
serverProcess Server m s a b
server s
s a
a
forall (m :: * -> *) a. Monad m => a -> m a
return (s
s', b
b, Double
0)
Double
t2 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics forall (m :: * -> *). Monad m => Dynamics m Double
time
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
EventLift t m =>
Event m a -> t m a
liftEvent forall a b. (a -> b) -> a -> b
$
do forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m s
serverStateRef Server m s a b
server) forall a b. (a -> b) -> a -> b
$! s
s'
forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server) (forall a. Num a => a -> a -> a
+ (Double
t2 forall a. Num a => a -> a -> a
- Double
t1 forall a. Num a => a -> a -> a
- Double
dt))
forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverProcessingTimeRef Server m s a b
server) forall a b. (a -> b) -> a -> b
$
forall a. SamplingData a => a -> SamplingStats a -> SamplingStats a
addSamplingStats (Double
t2 forall a. Num a => a -> a -> a
- Double
t1 forall a. Num a => a -> a -> a
- Double
dt)
forall (m :: * -> *) a. SignalSource m a -> a -> Event m ()
triggerSignal (forall (m :: * -> *) s a b. Server m s a b -> SignalSource m (a, b)
serverTaskProcessedSource Server m s a b
server) (a
a, b
b)
forall (m :: * -> *) a. Monad m => a -> m a
return (b
b, s -> Maybe (Double, a, b) -> Stream m a -> Stream m b
loop s
s' (forall a. a -> Maybe a
Just (Double
t2, a
a, b
b)) Stream m a
xs')
serverProcessPreempting :: MonadDES m => Server m s a b -> s -> a -> Process m (s, b, Double)
{-# INLINABLE serverProcessPreempting #-}
serverProcessPreempting :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> s -> a -> Process m (s, b, Double)
serverProcessPreempting Server m s a b
server s
s a
a =
do ProcessId m
pid <- forall (m :: * -> *). MonadDES m => Process m (ProcessId m)
processId
Double
t1 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics forall (m :: * -> *). Monad m => Dynamics m Double
time
Ref m Double
rs <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
SimulationLift t m =>
Simulation m a -> t m a
liftSimulation forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef Double
0
Ref m Double
r1 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
SimulationLift t m =>
Simulation m a -> t m a
liftSimulation forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => a -> Simulation m (Ref m a)
newRef Double
t1
DisposableEvent m
h1 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
EventLift t m =>
Event m a -> t m a
liftEvent forall a b. (a -> b) -> a -> b
$
forall (m :: * -> *) a.
Signal m a -> (a -> Event m ()) -> Event m (DisposableEvent m)
handleSignal (forall (m :: * -> *). MonadDES m => ProcessId m -> Signal m ()
processPreemptionBeginning ProcessId m
pid) forall a b. (a -> b) -> a -> b
$ \() ->
do Double
t1 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics forall (m :: * -> *). Monad m => Dynamics m Double
time
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef Ref m Double
r1 Double
t1
forall (m :: * -> *) a. SignalSource m a -> a -> Event m ()
triggerSignal (forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverTaskPreemptionBeginningSource Server m s a b
server) a
a
DisposableEvent m
h2 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
EventLift t m =>
Event m a -> t m a
liftEvent forall a b. (a -> b) -> a -> b
$
forall (m :: * -> *) a.
Signal m a -> (a -> Event m ()) -> Event m (DisposableEvent m)
handleSignal (forall (m :: * -> *). MonadDES m => ProcessId m -> Signal m ()
processPreemptionEnding ProcessId m
pid) forall a b. (a -> b) -> a -> b
$ \() ->
do Double
t1 <- forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef Ref m Double
r1
Double
t2 <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
DynamicsLift t m =>
Dynamics m a -> t m a
liftDynamics forall (m :: * -> *). Monad m => Dynamics m Double
time
let dt :: Double
dt = Double
t2 forall a. Num a => a -> a -> a
- Double
t1
forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef Ref m Double
rs (forall a. Num a => a -> a -> a
+ Double
dt)
forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server) (forall a. Num a => a -> a -> a
+ Double
dt)
forall (m :: * -> *) a.
MonadRef m =>
Ref m a -> (a -> a) -> Event m ()
modifyRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverPreemptionTimeRef Server m s a b
server) forall a b. (a -> b) -> a -> b
$
forall a. SamplingData a => a -> SamplingStats a -> SamplingStats a
addSamplingStats Double
dt
forall (m :: * -> *) a. SignalSource m a -> a -> Event m ()
triggerSignal (forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverTaskPreemptionEndingSource Server m s a b
server) a
a
let m1 :: Process m (s, b, Double)
m1 =
do (s
s', b
b) <- forall (m :: * -> *) s a b.
Server m s a b -> s -> a -> Process m (s, b)
serverProcess Server m s a b
server s
s a
a
Double
dt <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
EventLift t m =>
Event m a -> t m a
liftEvent forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef Ref m Double
rs
forall (m :: * -> *) a. Monad m => a -> m a
return (s
s', b
b, Double
dt)
m2 :: Process m ()
m2 =
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
EventLift t m =>
Event m a -> t m a
liftEvent forall a b. (a -> b) -> a -> b
$
do forall (m :: * -> *). DisposableEvent m -> Event m ()
disposeEvent DisposableEvent m
h1
forall (m :: * -> *). DisposableEvent m -> Event m ()
disposeEvent DisposableEvent m
h2
forall (m :: * -> *) a b.
MonadDES m =>
Process m a -> Process m b -> Process m a
finallyProcess Process m (s, b, Double)
m1 Process m ()
m2
serverState :: MonadDES m => Server m s a b -> Event m s
{-# INLINABLE serverState #-}
serverState :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m s
serverState Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m s
serverStateRef Server m s a b
server)
serverStateChanged :: MonadDES m => Server m s a b -> Signal m s
{-# INLINABLE serverStateChanged #-}
serverStateChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m s
serverStateChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m s
serverState Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverStateChanged_ Server m s a b
server)
serverStateChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverStateChanged_ #-}
serverStateChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverStateChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server)
serverTotalInputWaitTime :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverTotalInputWaitTime #-}
serverTotalInputWaitTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalInputWaitTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server)
serverTotalInputWaitTimeChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverTotalInputWaitTimeChanged #-}
serverTotalInputWaitTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverTotalInputWaitTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalInputWaitTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalInputWaitTimeChanged_ Server m s a b
server)
serverTotalInputWaitTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverTotalInputWaitTimeChanged_ #-}
serverTotalInputWaitTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalInputWaitTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived Server m s a b
server)
serverTotalProcessingTime :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverTotalProcessingTime #-}
serverTotalProcessingTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalProcessingTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server)
serverTotalProcessingTimeChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverTotalProcessingTimeChanged #-}
serverTotalProcessingTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverTotalProcessingTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalProcessingTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalProcessingTimeChanged_ Server m s a b
server)
serverTotalProcessingTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverTotalProcessingTimeChanged_ #-}
serverTotalProcessingTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalProcessingTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server)
serverTotalOutputWaitTime :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverTotalOutputWaitTime #-}
serverTotalOutputWaitTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalOutputWaitTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server)
serverTotalOutputWaitTimeChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverTotalOutputWaitTimeChanged #-}
serverTotalOutputWaitTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverTotalOutputWaitTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalOutputWaitTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalOutputWaitTimeChanged_ Server m s a b
server)
serverTotalOutputWaitTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverTotalOutputWaitTimeChanged_ #-}
serverTotalOutputWaitTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalOutputWaitTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided Server m s a b
server)
serverTotalPreemptionTime :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverTotalPreemptionTime #-}
serverTotalPreemptionTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalPreemptionTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server)
serverTotalPreemptionTimeChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverTotalPreemptionTimeChanged #-}
serverTotalPreemptionTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverTotalPreemptionTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverTotalPreemptionTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalPreemptionTimeChanged_ Server m s a b
server)
serverTotalPreemptionTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverTotalPreemptionTimeChanged_ #-}
serverTotalPreemptionTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverTotalPreemptionTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding Server m s a b
server)
serverInputWaitTime :: MonadDES m => Server m s a b -> Event m (SamplingStats Double)
{-# INLINABLE serverInputWaitTime #-}
serverInputWaitTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverInputWaitTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverInputWaitTimeRef Server m s a b
server)
serverInputWaitTimeChanged :: MonadDES m => Server m s a b -> Signal m (SamplingStats Double)
{-# INLINABLE serverInputWaitTimeChanged #-}
serverInputWaitTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (SamplingStats Double)
serverInputWaitTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverInputWaitTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitTimeChanged_ Server m s a b
server)
serverInputWaitTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverInputWaitTimeChanged_ #-}
serverInputWaitTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived Server m s a b
server)
serverProcessingTime :: MonadDES m => Server m s a b -> Event m (SamplingStats Double)
{-# INLINABLE serverProcessingTime #-}
serverProcessingTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverProcessingTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverProcessingTimeRef Server m s a b
server)
serverProcessingTimeChanged :: MonadDES m => Server m s a b -> Signal m (SamplingStats Double)
{-# INLINABLE serverProcessingTimeChanged #-}
serverProcessingTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (SamplingStats Double)
serverProcessingTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverProcessingTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingTimeChanged_ Server m s a b
server)
serverProcessingTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverProcessingTimeChanged_ #-}
serverProcessingTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server)
serverOutputWaitTime :: MonadDES m => Server m s a b -> Event m (SamplingStats Double)
{-# INLINABLE serverOutputWaitTime #-}
serverOutputWaitTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverOutputWaitTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverOutputWaitTimeRef Server m s a b
server)
serverOutputWaitTimeChanged :: MonadDES m => Server m s a b -> Signal m (SamplingStats Double)
{-# INLINABLE serverOutputWaitTimeChanged #-}
serverOutputWaitTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (SamplingStats Double)
serverOutputWaitTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverOutputWaitTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitTimeChanged_ Server m s a b
server)
serverOutputWaitTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverOutputWaitTimeChanged_ #-}
serverOutputWaitTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided Server m s a b
server)
serverPreemptionTime :: MonadDES m => Server m s a b -> Event m (SamplingStats Double)
{-# INLINABLE serverPreemptionTime #-}
serverPreemptionTime :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverPreemptionTime Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p -> forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverPreemptionTimeRef Server m s a b
server)
serverPreemptionTimeChanged :: MonadDES m => Server m s a b -> Signal m (SamplingStats Double)
{-# INLINABLE serverPreemptionTimeChanged #-}
serverPreemptionTimeChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (SamplingStats Double)
serverPreemptionTimeChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m (SamplingStats Double)
serverPreemptionTime Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionTimeChanged_ Server m s a b
server)
serverPreemptionTimeChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverPreemptionTimeChanged_ #-}
serverPreemptionTimeChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionTimeChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding Server m s a b
server)
serverInputWaitFactor :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverInputWaitFactor #-}
serverInputWaitFactor :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverInputWaitFactor Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do Double
x1 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server)
Double
x2 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server)
Double
x3 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server)
Double
x4 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server)
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
x1 forall a. Fractional a => a -> a -> a
/ (Double
x1 forall a. Num a => a -> a -> a
+ Double
x2 forall a. Num a => a -> a -> a
+ Double
x3 forall a. Num a => a -> a -> a
+ Double
x4))
serverInputWaitFactorChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverInputWaitFactorChanged #-}
serverInputWaitFactorChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverInputWaitFactorChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverInputWaitFactor Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitFactorChanged_ Server m s a b
server)
serverInputWaitFactorChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverInputWaitFactorChanged_ #-}
serverInputWaitFactorChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverInputWaitFactorChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding Server m s a b
server)
serverProcessingFactor :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverProcessingFactor #-}
serverProcessingFactor :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverProcessingFactor Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do Double
x1 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server)
Double
x2 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server)
Double
x3 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server)
Double
x4 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server)
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
x2 forall a. Fractional a => a -> a -> a
/ (Double
x1 forall a. Num a => a -> a -> a
+ Double
x2 forall a. Num a => a -> a -> a
+ Double
x3 forall a. Num a => a -> a -> a
+ Double
x4))
serverProcessingFactorChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverProcessingFactorChanged #-}
serverProcessingFactorChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverProcessingFactorChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverProcessingFactor Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingFactorChanged_ Server m s a b
server)
serverProcessingFactorChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverProcessingFactorChanged_ #-}
serverProcessingFactorChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverProcessingFactorChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding Server m s a b
server)
serverOutputWaitFactor :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverOutputWaitFactor #-}
serverOutputWaitFactor :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverOutputWaitFactor Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do Double
x1 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server)
Double
x2 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server)
Double
x3 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server)
Double
x4 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server)
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
x3 forall a. Fractional a => a -> a -> a
/ (Double
x1 forall a. Num a => a -> a -> a
+ Double
x2 forall a. Num a => a -> a -> a
+ Double
x3 forall a. Num a => a -> a -> a
+ Double
x4))
serverOutputWaitFactorChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverOutputWaitFactorChanged #-}
serverOutputWaitFactorChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverOutputWaitFactorChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverOutputWaitFactor Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitFactorChanged_ Server m s a b
server)
serverOutputWaitFactorChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverOutputWaitFactorChanged_ #-}
serverOutputWaitFactorChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverOutputWaitFactorChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding Server m s a b
server)
serverPreemptionFactor :: MonadDES m => Server m s a b -> Event m Double
{-# INLINABLE serverPreemptionFactor #-}
serverPreemptionFactor :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverPreemptionFactor Server m s a b
server =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do Double
x1 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server)
Double
x2 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server)
Double
x3 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server)
Double
x4 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server)
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
x4 forall a. Fractional a => a -> a -> a
/ (Double
x1 forall a. Num a => a -> a -> a
+ Double
x2 forall a. Num a => a -> a -> a
+ Double
x3 forall a. Num a => a -> a -> a
+ Double
x4))
serverPreemptionFactorChanged :: MonadDES m => Server m s a b -> Signal m Double
{-# INLINABLE serverPreemptionFactorChanged #-}
serverPreemptionFactorChanged :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m Double
serverPreemptionFactorChanged Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> Event m b) -> Signal m a -> Signal m b
mapSignalM (forall a b. a -> b -> a
const forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m Double
serverPreemptionFactor Server m s a b
server) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionFactorChanged_ Server m s a b
server)
serverPreemptionFactorChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverPreemptionFactorChanged_ #-}
serverPreemptionFactorChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverPreemptionFactorChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding Server m s a b
server)
serverInputReceived :: MonadDES m => Server m s a b -> Signal m a
{-# INLINABLE serverInputReceived #-}
serverInputReceived :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived = forall (m :: * -> *) a. SignalSource m a -> Signal m a
publishSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverInputReceivedSource
serverTaskPreemptionBeginning :: MonadDES m => Server m s a b -> Signal m a
{-# INLINABLE serverTaskPreemptionBeginning #-}
serverTaskPreemptionBeginning :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionBeginning = forall (m :: * -> *) a. SignalSource m a -> Signal m a
publishSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverTaskPreemptionBeginningSource
serverTaskPreemptionEnding :: MonadDES m => Server m s a b -> Signal m a
{-# INLINABLE serverTaskPreemptionEnding #-}
serverTaskPreemptionEnding :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding = forall (m :: * -> *) a. SignalSource m a -> Signal m a
publishSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) s a b. Server m s a b -> SignalSource m a
serverTaskPreemptionEndingSource
serverTaskProcessed :: MonadDES m => Server m s a b -> Signal m (a, b)
{-# INLINABLE serverTaskProcessed #-}
serverTaskProcessed :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed = forall (m :: * -> *) a. SignalSource m a -> Signal m a
publishSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) s a b. Server m s a b -> SignalSource m (a, b)
serverTaskProcessedSource
serverOutputProvided :: MonadDES m => Server m s a b -> Signal m (a, b)
{-# INLINABLE serverOutputProvided #-}
serverOutputProvided :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided = forall (m :: * -> *) a. SignalSource m a -> Signal m a
publishSignal forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) s a b. Server m s a b -> SignalSource m (a, b)
serverOutputProvidedSource
serverChanged_ :: MonadDES m => Server m s a b -> Signal m ()
{-# INLINABLE serverChanged_ #-}
serverChanged_ :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m ()
serverChanged_ Server m s a b
server =
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverInputReceived Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverTaskProcessed Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m (a, b)
serverOutputProvided Server m s a b
server) forall a. Semigroup a => a -> a -> a
<>
forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Signal m a -> Signal m b
mapSignal (forall a b. a -> b -> a
const ()) (forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Signal m a
serverTaskPreemptionEnding Server m s a b
server)
serverSummary :: MonadDES m => Server m s a b -> Int -> Event m ShowS
{-# INLINABLE serverSummary #-}
serverSummary :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Int -> Event m ShowS
serverSummary Server m s a b
server Int
indent =
forall (m :: * -> *) a. (Point m -> m a) -> Event m a
Event forall a b. (a -> b) -> a -> b
$ \Point m
p ->
do Double
tx1 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server)
Double
tx2 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server)
Double
tx3 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server)
Double
tx4 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server)
let xf1 :: Double
xf1 = Double
tx1 forall a. Fractional a => a -> a -> a
/ (Double
tx1 forall a. Num a => a -> a -> a
+ Double
tx2 forall a. Num a => a -> a -> a
+ Double
tx3 forall a. Num a => a -> a -> a
+ Double
tx4)
xf2 :: Double
xf2 = Double
tx2 forall a. Fractional a => a -> a -> a
/ (Double
tx1 forall a. Num a => a -> a -> a
+ Double
tx2 forall a. Num a => a -> a -> a
+ Double
tx3 forall a. Num a => a -> a -> a
+ Double
tx4)
xf3 :: Double
xf3 = Double
tx3 forall a. Fractional a => a -> a -> a
/ (Double
tx1 forall a. Num a => a -> a -> a
+ Double
tx2 forall a. Num a => a -> a -> a
+ Double
tx3 forall a. Num a => a -> a -> a
+ Double
tx4)
xf4 :: Double
xf4 = Double
tx4 forall a. Fractional a => a -> a -> a
/ (Double
tx1 forall a. Num a => a -> a -> a
+ Double
tx2 forall a. Num a => a -> a -> a
+ Double
tx3 forall a. Num a => a -> a -> a
+ Double
tx4)
SamplingStats Double
xs1 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverInputWaitTimeRef Server m s a b
server)
SamplingStats Double
xs2 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverProcessingTimeRef Server m s a b
server)
SamplingStats Double
xs3 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverOutputWaitTimeRef Server m s a b
server)
SamplingStats Double
xs4 <- forall (m :: * -> *) a. Point m -> Event m a -> m a
invokeEvent Point m
p forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. MonadRef m => Ref m a -> Event m a
readRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverPreemptionTimeRef Server m s a b
server)
let tab :: [Char]
tab = forall a. Int -> a -> [a]
replicate Int
indent Char
' '
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"total input wait time (locked while awaiting the input) = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
tx1 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"total processing time = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
tx2 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"total output wait time (locked while delivering the output) = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
tx3 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"total preemption time = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
tx4 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"input wait factor (from 0 to 1) = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
xf1 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"processing factor (from 0 to 1) = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
xf2 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"output wait factor (from 0 to 1) = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
xf3 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"output preemption factor (from 0 to 1) = " forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> ShowS
shows Double
xf4 forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"input wait time (locked while awaiting the input):\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall a. Show a => SamplingStats a -> Int -> ShowS
samplingStatsSummary SamplingStats Double
xs1 (Int
2 forall a. Num a => a -> a -> a
+ Int
indent) forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"processing time:\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall a. Show a => SamplingStats a -> Int -> ShowS
samplingStatsSummary SamplingStats Double
xs2 (Int
2 forall a. Num a => a -> a -> a
+ Int
indent) forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"output wait time (locked while delivering the output):\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall a. Show a => SamplingStats a -> Int -> ShowS
samplingStatsSummary SamplingStats Double
xs3 (Int
2 forall a. Num a => a -> a -> a
+ Int
indent) forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
tab forall b c a. (b -> c) -> (a -> b) -> a -> c
.
[Char] -> ShowS
showString [Char]
"preemption time (waiting for the proceeding after preemption):\n\n" forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall a. Show a => SamplingStats a -> Int -> ShowS
samplingStatsSummary SamplingStats Double
xs4 (Int
2 forall a. Num a => a -> a -> a
+ Int
indent)
resetServer :: MonadDES m => Server m s a b -> Event m ()
{-# INLINABLE resetServer #-}
resetServer :: forall (m :: * -> *) s a b.
MonadDES m =>
Server m s a b -> Event m ()
resetServer Server m s a b
server =
do forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalInputWaitTimeRef Server m s a b
server) Double
0
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalProcessingTimeRef Server m s a b
server) Double
0
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalOutputWaitTimeRef Server m s a b
server) Double
0
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b. Server m s a b -> Ref m Double
serverTotalPreemptionTimeRef Server m s a b
server) Double
0
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverInputWaitTimeRef Server m s a b
server) forall a. Monoid a => a
mempty
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverProcessingTimeRef Server m s a b
server) forall a. Monoid a => a
mempty
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverOutputWaitTimeRef Server m s a b
server) forall a. Monoid a => a
mempty
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> Event m ()
writeRef (forall (m :: * -> *) s a b.
Server m s a b -> Ref m (SamplingStats Double)
serverPreemptionTimeRef Server m s a b
server) forall a. Monoid a => a
mempty