-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix retrieval of temperature history data (fix #494) #557
base: master
Are you sure you want to change the base?
Conversation
bca8876
to
7d50795
Compare
Also, to mitigate this change, the default |
@AnalogJ I'd like to have your feedback on this PR. Here is a screenshot of my temperature history graph (with temperature history retrieval enabled) : |
6dd5c67
to
ebc4193
Compare
(not tested yet)
Hey @mcarbonne appreciate your work here -- but yeah I'd rather add a switch to enable/disable it, rather than remove it completely |
Thanks for you feedback. I have updated my PR with your suggestions but I have not yet been able to test this change: I have build issues (npm related) but haven't found out if it's related to my changes but it is similar to the nightly build issue. I'll try to investigate when I have time. |
@AnalogJ build is working again, feature is behaving as expected, docker image is available (ghcr.io/mcarbonne/scrutiny:master-omnibus). Feel free to give me your feedback. |
Conflicts: webapp/backend/pkg/database/scrutiny_repository_migrations.go
@AnalogJ PR updated :) |
Would be great if this could get merged anytime soon. |
This looks good, let me check why the CI isn't running. |
I did some testing on my fork and indeed, workflows need a little update. I included it in my PR (commit b7d57c0). This is mandatory according to documentation:
EDIT : this is a breaking change with v4: |
This PR allow temperature history data to be retrieved correctly, usingIndex
andSize
fields.collectorSmartData.AtaSctTemperatureHistory.Table
is now managed as a circular buffer, starting fromIndex
.EDIT : I was wrong. The SCT temperature history table is indeed a circular buffer starting from index.
But when outputting json,
smartmontools
do re-order entries: first = oldest, last = most recent (seeataPrintSCTTempHist
fromsmartmontools
).Details about spec here:
https://tc.gts3.org/cs3210/2016/spring/r/hardware/ATA8-ACS.pdf
(table 82 mostly)
And json generation from smartmontools here:
https://github.com/mirror/smartmontools/blob/master/ataprint.cpp (function
ataPrintSCTTempHist
)Anyway, based on my observations,
ataPrintSCTTempHist
isn't reliable. I tested on 4 SSD (kingston, 2x micron, crucial) and none are fully compliant with the specification.Here are some issues I found:
logging_interval_minutes
/sampling_period_minutes
isn't always correct.Example (Micron 5200 Pro):
2 minutes later :
Most likely, the "real" logging interval is ~ 30 seconds, but this interval is stored in an integer, it cannot work.
Therefore, only the current temperature (the last element of the table from json output) is correct.
0x80
, translated tonull
in json and0
ingo
) but:0x80
when resuming from sleep.All values before this magical values must be ignored (because timestamp cannot be guessed). The current implementation only ignore "null" values, but not all the values before.
Current implementation seems to parse the history the wrong way (first=most recent, last=oldest).@AnalogJ maybe you have more data than me to confirm my observations. If you agree, my proposal is to simply remove history retrieval.
Note: This will fix #494 once for all