language-puppet-1.0.1: Tools to parse and evaluate the Puppet DSL.

Safe HaskellSafe-Inferred
LanguageHaskell98

Puppet.Stats

Description

A quickly done module that exports utility functions used to collect various statistics. All statistics are stored in a MVar holding a HashMap.

This is not accurate in the presence of lazy evaluation. Nothing is forced.

Synopsis

Documentation

measure Source

Arguments

:: MStats

Statistics container

-> Text

Action identifier

-> IO a

Computation

-> IO a 

Wraps a computation, and measures related execution statistics.

measure_ :: MStats -> Text -> IO a -> IO () Source

Just like measure, discarding the result value.

newStats :: IO MStats Source

Create a new statistical container.

getStats :: MStats -> IO StatsTable Source

Returns the actual statistical values.

type StatsTable = HashMap Text StatsPoint Source

A table where keys are the names of the computations, and values are StatsPoints.

data StatsPoint Source

Constructors

StatsPoint 

Fields

_statspointCount :: !Int

Total number of calls to a computation

_statspointTotal :: !Double

Total time spent during this computation

_statspointMin :: !Double

Minimum execution time

_statspointMax :: !Double

Maximum execution time

Instances