#61 SMART Error message table - #208
Open
JasmineRRod wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the SMART tab UI to surface additional drive identity/health metadata and adds an NVMe-focused attributes table, backed by new JSON fields parsed from smartctl --json -a.
Changes:
- Added new Drive Info fields (model family, drive type, SMART DB presence) and an ATA trip-temperature display.
- Added a new “NVMe SMART Attributes” table section populated from the NVMe health log.
- Extended SMART JSON parsing to include
rotation_rateandin_smartctl_database.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
jdm-core/src/main/java/jdiskmark/SmartPanel.java |
Adds new labels/sections and populates a new NVMe attributes table in the SMART tab UI. |
jdm-core/src/main/java/jdiskmark/Smart.java |
Adds parsed fields for rotation_rate and in_smartctl_database used by the SMART UI. |
Suppressed comments (2)
jdm-core/src/main/java/jdiskmark/SmartPanel.java:670
tempTripValueLabelis never reset when the current SMART payload lacks a drive trip temperature (e.g., NVMe drives). This can leave a stale trip temperature from a prior ATA drive. Reset it before the temperature branch so each populate() reflects only current data.
// Temperature — prefer top-level block, fall back to NVMe health log
if (d.getTemperature() != null && d.getTemperature().getCurrent() != null) {
int t = d.getTemperature().getCurrent();
tempValueLabel.setText(t + " °C");
tempValueLabel.setForeground(tempColor(t));
jdm-core/src/main/java/jdiskmark/SmartPanel.java:607
inDatabaseValueLabelis only updated whenin_smartctl_databaseis present. If the field is absent in a later populate(), the label/colour can remain from the previous drive/session. Set text/foreground for the null case to avoid stale UI state.
// in_smartctl_database: whether attribute names/thresholds are reliable
if (d.getInSmartctlDatabase() != null) {
boolean inDb = d.getInSmartctlDatabase();
inDatabaseValueLabel.setText(inDb ? "Yes ✔" : "No — thresholds may be unreliable");
inDatabaseValueLabel.setForeground(inDb ? null : new Color(0xFF9800));
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+596
to
+600
| // rotation_rate: 0 = SSD, >0 = HDD with that RPM, null = unknown | ||
| if (d.getRotationRate() != null) { | ||
| int rpm = d.getRotationRate(); | ||
| driveTypeValueLabel.setText(rpm == 0 ? "SSD (non-rotating)" : "HDD (" + rpm + " RPM)"); | ||
| } |
Member
There was a problem hiding this comment.
@JasmineRRod this sounds like a good suggestion to me
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.
Added error log table for the NVMe drives:
Temperature: The primary temperature of the drive.
Available Spare: The percentage of remaining NAND blocks that the controller can substitute for worn-out blocks. It starts at 100% and decreases as the blocks retire.
Available Spare Threshold: The manufacturer-set floor for available spare. If the spare reaches this value, it is considered end-of-life to a NAND perspective.
Percentage Used: A percentage that records the cumulative endurance of the drive's life. 100% doesn't mean that the drive is dead — it means the warranty write endurance has been consumed.
Data Units Written: Total data written to the drive expressed in GB and the raw unit count (1 unit = 512,000 bytes ≈ 500 KB).
Data Units Read: The total data read from the drive, in GB, and the raw unit count (1 unit = 512,000 bytes ≈ 500 KB). High read counts are normal and don't wear NAND.
Host Write Commands: Total number of individual write commands issued by the host over the drive's lifetime.
Host Read Commands: Total number of individual read commands from the host.
Controller Busy Time: Total time (in minutes) the NVMe controller was actively processing I/O.
Power Cycles: Number of times the drive has been powered on and off.
Power On Hours: Total hours the drive has been powered on since manufacture.
Unsafe Shutdowns: Number of times the drive lost power without a clean shutdown sequence.
Media and Data Integrity Errors: Count of errors detected by the controller's ECC system that could not be recovered. This value should be 0; any nonzero number is a serious risk.
Error Information Log Entries: Number of entries in the NVMe Error Information Log. Each entry represents a command that completed with an error. A value that is not 0 should be investigated, but it is not considered as harmful as other errors.
Warning Composite Temp Time: Cumulative minutes the drive has operated above its Warning Composite Temperature (WCTEMP). Non-zero means the drive has been thermally stressed at some point in its life.
Critical Composite Temp Time: The cumulative minutes above the Critical Composite Temperature (CCTEMP).
Temperature Sensor N: Individual sensor readings (some drives expose 2–4 sensors covering different areas: NAND die, controller, board).