Copyright | Copyright (c) 2009-2016, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
Tested with: GHC 8.0.1
Represents statistics.
- data SamplingStats a :: * -> * = SamplingStats {
- samplingStatsCount :: ~Int
- samplingStatsMin :: ~a
- samplingStatsMax :: ~a
- samplingStatsMean :: ~Double
- samplingStatsMean2 :: ~Double
- class Num a => SamplingData a where
- emptySamplingStats :: SamplingStats a
- addSamplingStats :: a -> SamplingStats a -> SamplingStats a
- combineSamplingStats :: SamplingStats a -> SamplingStats a -> SamplingStats a
- combineSamplingStatsEither :: SamplingData a => Either a (SamplingStats a) -> SamplingStats a -> SamplingStats a
- samplingStatsVariance :: SamplingStats a -> Double
- samplingStatsDeviation :: SamplingStats a -> Double
- samplingStatsSummary :: Show a => SamplingStats a -> Int -> ShowS
- returnSamplingStats :: SamplingData a => a -> SamplingStats a
- listSamplingStats :: SamplingData a => [a] -> SamplingStats a
- fromIntSamplingStats :: SamplingStats Int -> SamplingStats Double
- data TimingStats a :: * -> * = TimingStats {
- timingStatsCount :: ~Int
- timingStatsMin :: ~a
- timingStatsMax :: ~a
- timingStatsLast :: ~a
- timingStatsMinTime :: ~Double
- timingStatsMaxTime :: ~Double
- timingStatsStartTime :: ~Double
- timingStatsLastTime :: ~Double
- timingStatsSum :: ~Double
- timingStatsSum2 :: ~Double
- class Num a => TimingData a where
- emptyTimingStats :: TimingStats a
- addTimingStats :: Double -> a -> TimingStats a -> TimingStats a
- timingStatsMean :: TimingStats a -> Double
- timingStatsMean2 :: TimingStats a -> Double
- timingStatsVariance :: TimingStats a -> Double
- timingStatsDeviation :: TimingData a => TimingStats a -> Double
- timingStatsSummary :: (Show a, TimingData a) => TimingStats a -> Int -> ShowS
- returnTimingStats :: TimingData a => Double -> a -> TimingStats a
- fromIntTimingStats :: TimingStats Int -> TimingStats Double
- normTimingStats :: TimingData a => Int -> TimingStats a -> SamplingStats a
- data SamplingCounter a :: * -> * = SamplingCounter {}
- emptySamplingCounter :: SamplingData a => SamplingCounter a
- incSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a
- decSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a
- setSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a
- returnSamplingCounter :: SamplingData a => a -> SamplingCounter a
- data TimingCounter a :: * -> * = TimingCounter {}
- emptyTimingCounter :: TimingData a => TimingCounter a
- incTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a
- decTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a
- setTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a
- returnTimingCounter :: TimingData a => Double -> a -> TimingCounter a
Simple Statistics
data SamplingStats a :: * -> * #
Describes when the statistics consists of only samples not bound to the simulation time.
SamplingStats | |
|
Eq a => Eq (SamplingStats a) | |
Ord a => Ord (SamplingStats a) | |
Show a => Show (SamplingStats a) | |
SamplingData a => Monoid (SamplingStats a) | |
ResultItemable (ResultValue (SamplingStats Double)) Source # | |
ResultItemable (ResultValue (SamplingStats Int)) Source # | |
ResultComputing t m => ResultProvider (t m (SamplingStats Int)) m Source # | |
ResultComputing t m => ResultProvider (t m (SamplingStats Double)) m Source # | |
class Num a => SamplingData a where #
Specifies data type from which values we can gather the statistics.
combineSamplingStatsEither :: SamplingData a => Either a (SamplingStats a) -> SamplingStats a -> SamplingStats a #
If allows combining statistics more efficiently if we know that the first argument can be a scalar.
samplingStatsVariance :: SamplingStats a -> Double #
Return the variance.
samplingStatsDeviation :: SamplingStats a -> Double #
Return the deviation.
samplingStatsSummary :: Show a => SamplingStats a -> Int -> ShowS #
Show the summary of the statistics using the specified indent.
returnSamplingStats :: SamplingData a => a -> SamplingStats a #
Return the statistics by a single sample.
listSamplingStats :: SamplingData a => [a] -> SamplingStats a #
Create the statistics by the specified list of data.
fromIntSamplingStats :: SamplingStats Int -> SamplingStats Double #
Convert the statistics from integer to double values.
Timing Statistics
data TimingStats a :: * -> * #
This is the timing statistics where data are bound to the time.
TimingStats | |
|
Eq a => Eq (TimingStats a) | |
Ord a => Ord (TimingStats a) | |
(Show a, TimingData a) => Show (TimingStats a) | |
ResultItemable (ResultValue (TimingStats Double)) Source # | |
ResultItemable (ResultValue (TimingStats Int)) Source # | |
ResultComputing t m => ResultProvider (t m (TimingStats Int)) m Source # | |
ResultComputing t m => ResultProvider (t m (TimingStats Double)) m Source # | |
class Num a => TimingData a where #
Defines the data type from which values we can gather the timing statistics.
timingStatsDeviation :: TimingData a => TimingStats a -> Double #
Return the deviation.
timingStatsSummary :: (Show a, TimingData a) => TimingStats a -> Int -> ShowS #
Show the summary of the statistics using the specified indent.
returnTimingStats :: TimingData a => Double -> a -> TimingStats a #
Return the statistics by single timing data.
fromIntTimingStats :: TimingStats Int -> TimingStats Double #
Convert the statistics from integer to double values.
normTimingStats :: TimingData a => Int -> TimingStats a -> SamplingStats a #
Convert the statistics to its normalised sampling-based representation, where the first argument specifies the number of pseudo-samples.
Simple Counter
data SamplingCounter a :: * -> * #
A counter for which the statistics is collected too.
SamplingCounter | |
|
Eq a => Eq (SamplingCounter a) | |
Ord a => Ord (SamplingCounter a) | |
Show a => Show (SamplingCounter a) | |
ResultComputing t m => ResultProvider (t m (SamplingCounter Int)) m Source # | |
ResultComputing t m => ResultProvider (t m (SamplingCounter Double)) m Source # | |
emptySamplingCounter :: SamplingData a => SamplingCounter a #
An empty counter.
incSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a #
Increase the counter.
decSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a #
Decrease the counter.
setSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a #
Set a new value for the counter.
returnSamplingCounter :: SamplingData a => a -> SamplingCounter a #
Create a counter with the specified initial value.
Timing Counter
data TimingCounter a :: * -> * #
A counter for which the timing statistics is collected too.
TimingCounter | |
|
Eq a => Eq (TimingCounter a) | |
Ord a => Ord (TimingCounter a) | |
(Show a, TimingData a) => Show (TimingCounter a) | |
ResultComputing t m => ResultProvider (t m (TimingCounter Int)) m Source # | |
ResultComputing t m => ResultProvider (t m (TimingCounter Double)) m Source # | |
emptyTimingCounter :: TimingData a => TimingCounter a #
An empty counter.
incTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a #
Increase the counter at the specified time.
decTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a #
Decrease the counter at the specified time.
setTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a #
Set a new value for the counter at the specified time.
returnTimingCounter :: TimingData a => Double -> a -> TimingCounter a #
Create a timing counter with the specified initial value at the given time.