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

Safe HaskellNone

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

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 ()

Just like measure, discarding the result value.

newStats :: IO MStats

Create a new statistical container.

getStats :: MStats -> IO StatsTable

Returns the actual statistical values.

type StatsTable = HashMap Text StatsPoint

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

data StatsPoint

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

data MStats