cats-effect
cats-effect copied to clipboard
CPU starvation checker
Run a background fiber that detects CPU starvation by looking for clock drift when sleeping. Writes a warning to stderr if starvation is detected
It can be configured via the new system properties
cats.effect.cpu.starvation.check.interval: FiniteDuration: how long it should sleep for on each loopcats.effect.cpu.starvation.check.initialDelay: Duration: how long to wait before starting the check (set toDuration.Infto disable entirely)cats.effect.cpu.starvation.check.threshold: FiniteDuration: how much clock drift can be tolerated before warning
Resolves https://github.com/typelevel/cats-effect/issues/2762
@armanbilge are you still planning to do https://github.com/typelevel/cats-effect/pull/3098? Or should I add another parameter to toggle this on/off (instead of allowing initialDelay = Duration.Inf)?
Yup, feel free to base off https://github.com/typelevel/cats-effect/pull/3098.
Oh additional question: can we do this in a common location so it can be shared across the IOApps? This is even more useful on JavaScript than on the JVM!
Oh additional question: can we do this in a common location so it can be shared across the
IOApps? This is even more useful on JavaScript than on the JVM!
Yes, good point!
Apologies @djspiewak and @armanbilge for being so slow on this. Will try to get it over the line this week
Just need a couple adjustments and then I think we're good to go. I changed the base so we're now pointing to 3.4.x
Thank you!!