fix: Latest temperature may be insignificant in average computation#7
Open
clanoftheducks wants to merge 1 commit intoGnomedDev:masterfrom
Open
fix: Latest temperature may be insignificant in average computation#7clanoftheducks wants to merge 1 commit intoGnomedDev:masterfrom
clanoftheducks wants to merge 1 commit intoGnomedDev:masterfrom
Conversation
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.
The issue
I noticed that t2fanrd was often slower to react to temperature spikes than the 1s poll interval suggests.
I noticed that the following happens (here and following lines):
tempto the 50 samples / 5 seconds historytempsmean_temptempto historyAt the first poll after a sudden temperature spike (say, 50°C to 90°C in <1s1), the latest temp only contributes 1/50 to the average, and the integer
mean_tempmay not change. In practice, this often extends the reaction time to two intervals (up to 2s).Proposed change
When exiting a long sleep, append the extra samples before the average computation, instead of after. In other words, the latest temperature is taken into account for the past long sleep's duration (which is already the case for the short sleep), instead of the next's.
Let me know what you think.
Footnotes
T2 Macs tend to be quite old, and like mine, may have degraded thermal paste that basically render temp hikes instantaneous. ↩