Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Pythia.Services.Memory
Description
This module exports memory related services.
Since: 0.1
Synopsis
- queryMemory :: (MonadPathReader m, MonadThrow m, MonadTypedProcess m) => MemoryApp -> m SystemMemory
- freeMemory :: SystemMemory -> Memory
- percentageUsed :: SystemMemory -> Percentage
- percentageFree :: SystemMemory -> Percentage
- newtype Memory = MkMemory (Bytes B Natural)
- data SystemMemory = MkSystemMemory {}
- data MemoryApp = MemoryAppFree
Queries
queryMemory :: (MonadPathReader m, MonadThrow m, MonadTypedProcess m) => MemoryApp -> m SystemMemory Source #
Queries the memory based on the configuration.
Since: 0.1
Functions
freeMemory :: SystemMemory -> Memory Source #
Returns the amount of free memory.
Since: 0.1
percentageUsed :: SystemMemory -> Percentage Source #
Returns the used memory as a percentage.
Since: 0.1
percentageFree :: SystemMemory -> Percentage Source #
Returns the free memory as a percentage.
Since: 0.1
Types
Represents the current memory usage. The type parameter is some wrapper around the memory intended to enforce an invariant e.g. non-negative.
Since: 0.1
Instances
Generic Memory Source # | |
Show Memory Source # | Since: 0.1 |
NFData Memory Source # | Since: 0.1 |
Defined in Pythia.Services.Memory.Types | |
Eq Memory Source # | Since: 0.1 |
Display Memory Source # | Since: 0.1 |
Defined in Pythia.Services.Memory.Types | |
(k ~ An_Iso, a ~ Bytes 'B Natural, b ~ Bytes 'B Natural) => LabelOptic "unMemory" k Memory Memory a b Source # | Since: 0.1 |
Defined in Pythia.Services.Memory.Types | |
type Rep Memory Source # | Since: 0.1 |
Defined in Pythia.Services.Memory.Types |
data SystemMemory Source #
Represents the current memory usage.
Since: 0.1
Constructors
MkSystemMemory | |
Instances
Configuration
Determines how we should query the system for memory usage.
Since: 0.1
Constructors
MemoryAppFree | Uses the free utility. Since: 0.1 |
Instances
Bounded MemoryApp Source # | Since: 0.1 |
Enum MemoryApp Source # | Since: 0.1 |
Defined in Pythia.Services.Memory.Types Methods succ :: MemoryApp -> MemoryApp # pred :: MemoryApp -> MemoryApp # fromEnum :: MemoryApp -> Int # enumFrom :: MemoryApp -> [MemoryApp] # enumFromThen :: MemoryApp -> MemoryApp -> [MemoryApp] # enumFromTo :: MemoryApp -> MemoryApp -> [MemoryApp] # enumFromThenTo :: MemoryApp -> MemoryApp -> MemoryApp -> [MemoryApp] # | |
Generic MemoryApp Source # | |
Show MemoryApp Source # | Since: 0.1 |
NFData MemoryApp Source # | Since: 0.1.0.0 |
Defined in Pythia.Services.Memory.Types | |
Eq MemoryApp Source # | Since: 0.1 |
Ord MemoryApp Source # | Since: 0.1 |
type Rep MemoryApp Source # | Since: 0.1 |