Copyright | Copyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Tested with: GHC 7.8.3
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
- 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
- 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
- resetSamplingCounter :: SamplingData 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
- resetTimingCounter :: TimingData a => Double -> TimingCounter a -> TimingCounter a
- returnTimingCounter :: TimingData a => Double -> a -> TimingCounter a
Simple Statistics
data SamplingStats a Source
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)) | |
ResultItemable (ResultValue (SamplingStats Int)) | |
ResultComputing m => ResultProvider (m (SamplingStats Int)) | |
ResultComputing m => ResultProvider (m (SamplingStats Double)) |
class Num a => SamplingData a where Source
Specifies data type from which values we can gather the statistics.
emptySamplingStats :: SamplingStats a Source
An empty statistics that has no samples.
addSamplingStats :: a -> SamplingStats a -> SamplingStats a Source
Add a new sample to the statistics.
combineSamplingStats :: SamplingStats a -> SamplingStats a -> SamplingStats a Source
Combine two statistics.
combineSamplingStatsEither :: SamplingData a => Either a (SamplingStats a) -> SamplingStats a -> SamplingStats a Source
If allows combining statistics more efficiently if we know that the first argument can be a scalar.
samplingStatsVariance :: SamplingStats a -> Double Source
Return the variance.
samplingStatsDeviation :: SamplingStats a -> Double Source
Return the deviation.
samplingStatsSummary :: Show a => SamplingStats a -> Int -> ShowS Source
Show the summary of the statistics using the specified indent.
returnSamplingStats :: SamplingData a => a -> SamplingStats a Source
Return the statistics by a single sample.
listSamplingStats :: SamplingData a => [a] -> SamplingStats a Source
Create the statistics by the specified list of data.
fromIntSamplingStats :: SamplingStats Int -> SamplingStats Double Source
Convert the statistics from integer to double values.
Timing Statistics
data TimingStats a Source
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)) | |
ResultItemable (ResultValue (TimingStats Int)) | |
ResultComputing m => ResultProvider (m (TimingStats Int)) | |
ResultComputing m => ResultProvider (m (TimingStats Double)) |
class Num a => TimingData a where Source
Defines the data type from which values we can gather the timing statistics.
emptyTimingStats :: TimingStats a Source
An empty statistics that has no samples.
addTimingStats :: Double -> a -> TimingStats a -> TimingStats a Source
Add a sample with the specified time to the statistics.
timingStatsMean :: TimingStats a -> Double Source
Return the average value.
timingStatsVariance :: TimingStats a -> Double Source
Return the variance.
timingStatsDeviation :: TimingData a => TimingStats a -> Double Source
Return the deviation.
timingStatsSummary :: (Show a, TimingData a) => TimingStats a -> Int -> ShowS Source
Show the summary of the statistics using the specified indent.
returnTimingStats :: TimingData a => Double -> a -> TimingStats a Source
Return the statistics by single timing data.
fromIntTimingStats :: TimingStats Int -> TimingStats Double Source
Convert the statistics from integer to double values.
Simple Counter
data SamplingCounter a Source
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 m => ResultProvider (m (SamplingCounter Int)) | |
ResultComputing m => ResultProvider (m (SamplingCounter Double)) |
emptySamplingCounter :: SamplingData a => SamplingCounter a Source
An empty counter.
incSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a Source
Increase the counter.
decSamplingCounter :: SamplingData a => a -> SamplingCounter a -> SamplingCounter a Source
Decrease the counter.
resetSamplingCounter :: SamplingData a => SamplingCounter a -> SamplingCounter a Source
Reset the counter.
returnSamplingCounter :: SamplingData a => a -> SamplingCounter a Source
Create a counter with the specified initial value.
Timing Counter
data TimingCounter a Source
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 m => ResultProvider (m (TimingCounter Int)) | |
ResultComputing m => ResultProvider (m (TimingCounter Double)) |
emptyTimingCounter :: TimingData a => TimingCounter a Source
An empty counter.
incTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a Source
Increase the counter at the specified time.
decTimingCounter :: TimingData a => Double -> a -> TimingCounter a -> TimingCounter a Source
Decrease the counter at the specified time.
resetTimingCounter :: TimingData a => Double -> TimingCounter a -> TimingCounter a Source
Reset the counter at the specified time.
returnTimingCounter :: TimingData a => Double -> a -> TimingCounter a Source
Create a timing counter with the specified initial value at the given time.