Copyright | Copyright (c) 2009-2016 David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Tested with: GHC 8.0.1
The module defines useful result transformations that can be used in simulation experiments.
- class ResultTransformer a where
- newtype SamplingStats = SamplingStats ResultTransform
- samplingStatsCount :: SamplingStats -> ResultTransform
- samplingStatsMin :: SamplingStats -> ResultTransform
- samplingStatsMax :: SamplingStats -> ResultTransform
- samplingStatsMean :: SamplingStats -> ResultTransform
- samplingStatsMean2 :: SamplingStats -> ResultTransform
- samplingStatsVariance :: SamplingStats -> ResultTransform
- samplingStatsDeviation :: SamplingStats -> ResultTransform
- newtype TimingStats = TimingStats ResultTransform
- timingStatsCount :: TimingStats -> ResultTransform
- timingStatsMin :: TimingStats -> ResultTransform
- timingStatsMax :: TimingStats -> ResultTransform
- timingStatsMean :: TimingStats -> ResultTransform
- timingStatsVariance :: TimingStats -> ResultTransform
- timingStatsDeviation :: TimingStats -> ResultTransform
- timingStatsMinTime :: TimingStats -> ResultTransform
- timingStatsMaxTime :: TimingStats -> ResultTransform
- timingStatsStartTime :: TimingStats -> ResultTransform
- timingStatsLastTime :: TimingStats -> ResultTransform
- timingStatsSum :: TimingStats -> ResultTransform
- timingStatsSum2 :: TimingStats -> ResultTransform
- newtype SamplingCounter = SamplingCounter ResultTransform
- samplingCounterValue :: SamplingCounter -> ResultTransform
- samplingCounterStats :: SamplingCounter -> SamplingStats
- newtype TimingCounter = TimingCounter ResultTransform
- timingCounterValue :: TimingCounter -> ResultTransform
- timingCounterStats :: TimingCounter -> TimingStats
- newtype Queue = Queue ResultTransform
- enqueueStrategy :: Queue -> ResultTransform
- enqueueStoringStrategy :: Queue -> ResultTransform
- dequeueStrategy :: Queue -> ResultTransform
- queueNull :: Queue -> ResultTransform
- queueFull :: Queue -> ResultTransform
- queueMaxCount :: Queue -> ResultTransform
- queueCount :: Queue -> ResultTransform
- queueCountStats :: Queue -> TimingStats
- enqueueCount :: Queue -> ResultTransform
- enqueueLostCount :: Queue -> ResultTransform
- enqueueStoreCount :: Queue -> ResultTransform
- dequeueCount :: Queue -> ResultTransform
- dequeueExtractCount :: Queue -> ResultTransform
- queueLoadFactor :: Queue -> ResultTransform
- enqueueRate :: Queue -> ResultTransform
- enqueueStoreRate :: Queue -> ResultTransform
- dequeueRate :: Queue -> ResultTransform
- dequeueExtractRate :: Queue -> ResultTransform
- queueWaitTime :: Queue -> SamplingStats
- queueTotalWaitTime :: Queue -> SamplingStats
- enqueueWaitTime :: Queue -> SamplingStats
- dequeueWaitTime :: Queue -> SamplingStats
- queueRate :: Queue -> ResultTransform
- newtype ArrivalTimer = ArrivalTimer ResultTransform
- arrivalProcessingTime :: ArrivalTimer -> SamplingStats
- newtype Server = Server ResultTransform
- serverInitState :: Server -> ResultTransform
- serverState :: Server -> ResultTransform
- serverTotalInputWaitTime :: Server -> ResultTransform
- serverTotalProcessingTime :: Server -> ResultTransform
- serverTotalOutputWaitTime :: Server -> ResultTransform
- serverTotalPreemptionTime :: Server -> ResultTransform
- serverInputWaitTime :: Server -> SamplingStats
- serverProcessingTime :: Server -> SamplingStats
- serverOutputWaitTime :: Server -> SamplingStats
- serverPreemptionTime :: Server -> SamplingStats
- serverInputWaitFactor :: Server -> ResultTransform
- serverProcessingFactor :: Server -> ResultTransform
- serverOutputWaitFactor :: Server -> ResultTransform
- serverPreemptionFactor :: Server -> ResultTransform
- newtype Activity = Activity ResultTransform
- activityInitState :: Activity -> ResultTransform
- activityState :: Activity -> ResultTransform
- activityTotalUtilisationTime :: Activity -> ResultTransform
- activityTotalIdleTime :: Activity -> ResultTransform
- activityTotalPreemptionTime :: Activity -> ResultTransform
- activityUtilisationTime :: Activity -> SamplingStats
- activityIdleTime :: Activity -> SamplingStats
- activityPreemptionTime :: Activity -> SamplingStats
- activityUtilisationFactor :: Activity -> ResultTransform
- activityIdleFactor :: Activity -> ResultTransform
- activityPreemptionFactor :: Activity -> ResultTransform
- newtype Resource = Resource ResultTransform
- resourceCount :: Resource -> ResultTransform
- resourceCountStats :: Resource -> TimingStats
- resourceUtilisationCount :: Resource -> ResultTransform
- resourceUtilisationCountStats :: Resource -> TimingStats
- resourceQueueCount :: Resource -> ResultTransform
- resourceQueueCountStats :: Resource -> TimingStats
- resourceTotalWaitTime :: Resource -> ResultTransform
- resourceWaitTime :: Resource -> SamplingStats
- newtype Operation = Operation ResultTransform
- operationTotalUtilisationTime :: Operation -> ResultTransform
- operationTotalPreemptionTime :: Operation -> ResultTransform
- operationUtilisationTime :: Operation -> SamplingStats
- operationPreemptionTime :: Operation -> SamplingStats
- operationUtilisationFactor :: Operation -> ResultTransform
- operationPreemptionFactor :: Operation -> ResultTransform
Basic Class Type
class ResultTransformer a where Source #
Something that can transform the results.
tr :: a -> ResultTransform Source #
Return the result transform.
Sampling Statistics
newtype SamplingStats Source #
Represents a statistics based upon observations.
samplingStatsCount :: SamplingStats -> ResultTransform Source #
The total number of samples.
samplingStatsMin :: SamplingStats -> ResultTransform Source #
The minimum value among the samples.
samplingStatsMax :: SamplingStats -> ResultTransform Source #
The maximum value among the samples.
samplingStatsMean :: SamplingStats -> ResultTransform Source #
The average value.
samplingStatsMean2 :: SamplingStats -> ResultTransform Source #
The average square value.
samplingStatsVariance :: SamplingStats -> ResultTransform Source #
Return tha variance.
samplingStatsDeviation :: SamplingStats -> ResultTransform Source #
Return the deviation.
Time-dependent Statistics
newtype TimingStats Source #
The time-dependent statistics.
timingStatsCount :: TimingStats -> ResultTransform Source #
Return the number of samples.
timingStatsMin :: TimingStats -> ResultTransform Source #
Return the minimum value.
timingStatsMax :: TimingStats -> ResultTransform Source #
Return the maximum value.
timingStatsMean :: TimingStats -> ResultTransform Source #
Return the average value.
timingStatsVariance :: TimingStats -> ResultTransform Source #
Return the variance.
timingStatsDeviation :: TimingStats -> ResultTransform Source #
Return the deviation.
timingStatsMinTime :: TimingStats -> ResultTransform Source #
Return the time at which the minimum is attained.
timingStatsMaxTime :: TimingStats -> ResultTransform Source #
Return the time at which the maximum is attained.
timingStatsStartTime :: TimingStats -> ResultTransform Source #
Return the start time of sampling.
timingStatsLastTime :: TimingStats -> ResultTransform Source #
Return the last time of sampling.
timingStatsSum :: TimingStats -> ResultTransform Source #
Return the sum of values.
timingStatsSum2 :: TimingStats -> ResultTransform Source #
Return the sum of square values.
Sampling-based Counter
newtype SamplingCounter Source #
A counter for which the statistics is collected too.
samplingCounterValue :: SamplingCounter -> ResultTransform Source #
The counter value.
samplingCounterStats :: SamplingCounter -> SamplingStats Source #
The counter statistics.
Time-dependent Counter
newtype TimingCounter Source #
A time-dependent counter that collects the statistics too.
timingCounterValue :: TimingCounter -> ResultTransform Source #
The counter value.
timingCounterStats :: TimingCounter -> TimingStats Source #
The counter statistics.
Queue
Represents either finite or infinite queue.
enqueueStrategy :: Queue -> ResultTransform Source #
The strategy applied to the enqueueing (input) processes when the finite queue is full.
enqueueStoringStrategy :: Queue -> ResultTransform Source #
The strategy applied when storing (in memory) items in the queue.
dequeueStrategy :: Queue -> ResultTransform Source #
The strategy applied to the dequeueing (output) processes when the queue is empty.
queueNull :: Queue -> ResultTransform Source #
Test whether the queue is empty.
queueFull :: Queue -> ResultTransform Source #
Test whether the finite queue is full.
queueMaxCount :: Queue -> ResultTransform Source #
The finite queue capacity.
queueCount :: Queue -> ResultTransform Source #
Return the current queue size.
queueCountStats :: Queue -> TimingStats Source #
Return the queue size statistics.
enqueueCount :: Queue -> ResultTransform Source #
Return the total number of input items that were enqueued in the finite queue.
enqueueLostCount :: Queue -> ResultTransform Source #
Return the number of lost items for the finite queue.
enqueueStoreCount :: Queue -> ResultTransform Source #
Return the total number of input items that were stored.
dequeueCount :: Queue -> ResultTransform Source #
Return the total number of requests for dequeueing the items, not taking into account the failed attempts to dequeue immediately without suspension.
dequeueExtractCount :: Queue -> ResultTransform Source #
Return the total number of output items that were actually dequeued.
queueLoadFactor :: Queue -> ResultTransform Source #
Return the load factor: the finite queue size divided by its capacity.
enqueueRate :: Queue -> ResultTransform Source #
Return the rate of the input items that were enqueued in the finite queue: how many items per time.
enqueueStoreRate :: Queue -> ResultTransform Source #
Return the rate of the items that were stored: how many items per time.
dequeueRate :: Queue -> ResultTransform Source #
Return the rate of the requests for dequeueing the items: how many requests per time. It does not include the failed attempts to dequeue immediately without suspension.
dequeueExtractRate :: Queue -> ResultTransform Source #
Return the rate of the output items that were dequeued: how many items per time.
queueWaitTime :: Queue -> SamplingStats Source #
Return the wait time from the time at which the item was stored in the queue to the time at which it was dequeued.
queueTotalWaitTime :: Queue -> SamplingStats Source #
Return the total wait time for the finite queue from the time at which the enqueueing operation was initiated to the time at which the item was dequeued.
enqueueWaitTime :: Queue -> SamplingStats Source #
Return the wait time from the time at which the item was stored in the queue to the time at which it was dequeued.
dequeueWaitTime :: Queue -> SamplingStats Source #
Return the dequeue wait time from the time at which the item was requested for dequeueing to the time at which it was actually dequeued.
queueRate :: Queue -> ResultTransform Source #
Return a long-term average queue rate calculated as the average queue size divided by the average wait time.
Arrival Timer
newtype ArrivalTimer Source #
Accumulates the statistics about that how long the arrived events are processed.
arrivalProcessingTime :: ArrivalTimer -> SamplingStats Source #
Return the statistics about that how long the arrived events were processed.
Server
It models the server that prodives a service.
serverInitState :: Server -> ResultTransform Source #
The initial state of the server.
serverState :: Server -> ResultTransform Source #
Return the current state of the server.
serverTotalInputWaitTime :: Server -> ResultTransform Source #
Return the counted total time when the server was locked while awaiting the input.
serverTotalProcessingTime :: Server -> ResultTransform Source #
Return the counted total time spent by the server while processing the tasks.
serverTotalOutputWaitTime :: Server -> ResultTransform Source #
Return the counted total time when the server was locked while trying to deliver the output.
serverTotalPreemptionTime :: Server -> ResultTransform Source #
Return the counted total time spent by the server while it was preempted waiting for the further proceeding.
serverInputWaitTime :: Server -> SamplingStats Source #
Return the statistics of the time when the server was locked while awaiting the input.
serverProcessingTime :: Server -> SamplingStats Source #
Return the statistics of the time spent by the server while processing the tasks.
serverOutputWaitTime :: Server -> SamplingStats Source #
Return the statistics of the time when the server was locked while trying to deliver the output.
serverPreemptionTime :: Server -> SamplingStats Source #
Return the statistics of the time spent by the server while it was preempted waiting for the further proceeding.
serverInputWaitFactor :: Server -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the server was awaiting for the next input task.
serverProcessingFactor :: Server -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the server was busy with direct processing its tasks.
serverOutputWaitFactor :: Server -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the server was locked trying to deliver the output after the task is finished.
serverPreemptionFactor :: Server -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the server was preempted waiting for the further proceeding.
Activity
It models an activity that can be utilised.
activityInitState :: Activity -> ResultTransform Source #
The initial state of the activity.
activityState :: Activity -> ResultTransform Source #
Return the current state of the activity.
activityTotalUtilisationTime :: Activity -> ResultTransform Source #
Return the counted total time when the activity was utilised.
activityTotalIdleTime :: Activity -> ResultTransform Source #
Return the counted total time when the activity was idle.
activityTotalPreemptionTime :: Activity -> ResultTransform Source #
Return the counted total time when the activity was preemted waiting for the further proceeding.
activityUtilisationTime :: Activity -> SamplingStats Source #
Return the statistics for the time when the activity was utilised.
activityIdleTime :: Activity -> SamplingStats Source #
Return the statistics for the time when the activity was idle.
activityPreemptionTime :: Activity -> SamplingStats Source #
Return the statistics for the time when the activity was preempted waiting for the further proceeding.
activityUtilisationFactor :: Activity -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the activity was utilised.
activityIdleFactor :: Activity -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the activity was idle.
activityPreemptionFactor :: Activity -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the activity was preempted waiting for the further proceeding.
Resource
The resource which can be acquired and then released.
resourceCount :: Resource -> ResultTransform Source #
Return the current available count of the resource.
resourceCountStats :: Resource -> TimingStats Source #
Return the statistics for the available count of the resource.
resourceUtilisationCount :: Resource -> ResultTransform Source #
Return the current utilisation count of the resource.
resourceUtilisationCountStats :: Resource -> TimingStats Source #
Return the statistics for the utilisation count of the resource.
resourceQueueCount :: Resource -> ResultTransform Source #
Return the current queue length of the resource.
resourceQueueCountStats :: Resource -> TimingStats Source #
Return the statistics for the queue length of the resource.
resourceTotalWaitTime :: Resource -> ResultTransform Source #
Return the total wait time of the resource.
resourceWaitTime :: Resource -> SamplingStats Source #
Return the statistics for the wait time of the resource.
Operation
It models an opreation which actvity can be utilised.
operationTotalUtilisationTime :: Operation -> ResultTransform Source #
Return the counted total time when the operation activity was utilised.
operationTotalPreemptionTime :: Operation -> ResultTransform Source #
Return the counted total time when the operation activity was preemted waiting for the further proceeding.
operationUtilisationTime :: Operation -> SamplingStats Source #
Return the statistics for the time when the operation activity was utilised.
operationPreemptionTime :: Operation -> SamplingStats Source #
Return the statistics for the time when the operation activity was preempted waiting for the further proceeding.
operationUtilisationFactor :: Operation -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the operation activity was utilised.
operationPreemptionFactor :: Operation -> ResultTransform Source #
It returns the factor changing from 0 to 1, which estimates how often the operation activity was preempted waiting for the further proceeding.