ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Rts.Sampler

Description

The memory sampler: a background loop that reads the collector's statistics and the cgroup's memory use, and steers the meter's budget through Ecluse.Core.Server.Admission.Brake.

It runs off the served path. Without -T it still reads the cgroup, and without a cgroup limit it still reads the collector, so it never has a reason to stop.

Synopsis

Documentation

data SamplerSettings Source #

What one sampler loop reads and steers.

Constructors

SamplerSettings 

Fields

samplerPeriodMicros :: Int Source #

The sampling period: ten readings a second.

shareWindowPeriods :: Int Source #

The collector's CPU share averages over one second at the default period.

readCollector :: IO (IO (Maybe CollectorReading)) Source #

A reader for the collector's counters, or one that always reads nothing when -T is off.

runMemorySampler :: SamplerSettings -> IO () Source #

Sample and steer forever. The caller runs it under supervision and cancels it at shutdown.