| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hermod.Tracing.Resources
Description
OS-level and RTS resource sampling for the Hermod tracing system.
This is the only public module of the package. Import it and call
readResourceStats once per sampling interval to obtain a ResourceStats
snapshot. The value carries LogFormatting and MetaTrace instances and
can be fed directly into any Trace IO ResourceStats.
Platform support:
- Linux — CPU, GC, memory (RSS), block IO, filesystem IO, network (opt-in), threads.
- macOS — CPU, GC, memory (RSS), network IO, threads; disk IO stubbed.
- Windows — CPU, GC, memory (RSS), block I/O, threads.
- Other — GHC RTS metrics (CPU, GC, threads) only; OS fields report 0.
Synopsis
- data Resources a = Resources {}
- type ResourceStats = Resources Word64
- readResourceStats :: IO (Maybe ResourceStats)
Documentation
A snapshot of resource usage for the current process, parameterised over
the numeric type a. The concrete alias ResourceStats fixes a ~ Word64.
Fields that cannot be measured on the current platform are set to 0.
Constructors
| Resources | |
Fields
| |
Instances
type ResourceStats = Resources Word64 Source #
Concrete snapshot of resource usage with all fields as Word64 counts.
readResourceStats :: IO (Maybe ResourceStats) Source #
Sample resource usage of the current process.
Returns Nothing only when the underlying OS interface is unavailable
(e.g. /proc not mounted). Under normal operating conditions this
always returns Just.
The returned ResourceStats is a ; fields that
cannot be measured on the current platform are set to Resources Word640.