Add console as config in ioRuntimeConfig, pass it to CPUStarvation#3496
Merged
djspiewak merged 4 commits intotypelevel:series/3.xfrom May 3, 2023
Merged
Conversation
armanbilge
reviewed
Mar 15, 2023
core/shared/src/main/scala/cats/effect/unsafe/IORuntimeConfig.scala
Outdated
Show resolved
Hide resolved
added 2 commits
March 16, 2023 11:37
djspiewak
approved these changes
Apr 15, 2023
djspiewak
requested changes
Apr 15, 2023
| * Defines what to do when CpuStarvationCheck is triggered. Defaults to log a warning to | ||
| * System.err. | ||
| */ | ||
| protected def onCpuStarvationWarn: CpuStarvationWarningMetrics => IO[Unit] = |
Member
There was a problem hiding this comment.
Actually one quick nit: shouldn't this be a method, rather than a function?
Suggested change
| protected def onCpuStarvationWarn: CpuStarvationWarningMetrics => IO[Unit] = | |
| protected def onCpuStarvationWarn(metrics: CpuStarvationWarningMetrics): IO[Unit] = |
It means we can't define it in a point-free fashion, but the users are much more likely to define this in a non-point-free fashion, similar to reportFailure.
Author
There was a problem hiding this comment.
Will look into this tomorrow morning. 👍 Thanks for the review
djspiewak
approved these changes
May 3, 2023
Member
|
Thank you for taking this on! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #3495
Change CpuStarvation to take a function obtaining the metrics when there's a clock drift, to give the ability to the user to do as they want with the information. Defaults to the previous mechanism of logging into Sys.err