circuits-meter
Safe HaskellNone
LanguageGHC2024

Circuit.Meter.Space

Description

Space measurement as a Circuit.

GHC RTS allocation statistics read before and after a computation. allocX measures allocated bytes; SpaceStats is available for users who want the full RTS snapshot.

Synopsis

Space meter

allocX :: Meter (K IO) Bytes Bytes Source #

Measure only allocated bytes.

allocGC :: Meter (K IO) Bytes Bytes Source #

Measure allocated bytes with GC-forced boundaries.

Forces a major GC before reading the counter at both start and stop. This gives accurate per-interval allocation at the cost of GC overhead (a stop-the-world collection on every measurement boundary).

Use allocX for lightweight (but potentially stale) measurements; use allocGC when you need accurate per-stage numbers.

Types

data SpaceStats Source #

Allocation statistics from the GHC RTS.

Constructors

SpaceStats 

newtype Bytes Source #

Number of bytes.

Constructors

Bytes 

Fields

Instances

Instances details
Monoid Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Methods

mempty :: Bytes #

mappend :: Bytes -> Bytes -> Bytes #

mconcat :: [Bytes] -> Bytes #

Semigroup Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Methods

(<>) :: Bytes -> Bytes -> Bytes #

sconcat :: NonEmpty Bytes -> Bytes #

stimes :: Integral b => b -> Bytes -> Bytes #

Eq Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Methods

(==) :: Bytes -> Bytes -> Bool #

(/=) :: Bytes -> Bytes -> Bool #

Ord Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Methods

compare :: Bytes -> Bytes -> Ordering #

(<) :: Bytes -> Bytes -> Bool #

(<=) :: Bytes -> Bytes -> Bool #

(>) :: Bytes -> Bytes -> Bool #

(>=) :: Bytes -> Bytes -> Bool #

max :: Bytes -> Bytes -> Bytes #

min :: Bytes -> Bytes -> Bytes #

Enum Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Num Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Read Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Integral Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Real Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Methods

toRational :: Bytes -> Rational #

Show Bytes Source # 
Instance details

Defined in Circuit.Meter.Space

Methods

showsPrec :: Int -> Bytes -> ShowS #

show :: Bytes -> String #

showList :: [Bytes] -> ShowS #