language-puppet-0.12.1: 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

measureSource

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 MStatsSource

Create a new statistical container.

getStats :: MStats -> IO StatsTableSource

Returns the actual statistical values.

type StatsTable = HashMap Text StatsPointSource

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