Skip to content
Merged

Smart #176

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8a1fe18
#61 Smart Linux WIP
JasmineRRod Apr 25, 2026
2047a59
Merge branch 'dev' into smart
JasmineRRod Apr 25, 2026
5a507f7
Merge branch 'maven' into smart
jamesmarkchan May 17, 2026
e72d366
#61 refactor: rename Smart enable property to smartEnable for naming …
JasmineRRod May 18, 2026
a239992
#61 Heartbeat thread persist escalated shell
JasmineRRod May 18, 2026
cbd284b
#61 Shows the NVMe Health Log when no data is present
JasmineRRod May 25, 2026
5997375
Merge branch 'dev' into smart
jamesmarkchan Jun 8, 2026
7f34dc3
#61 remove duplicate
jamesmarkchan Jun 8, 2026
0e87c50
#61 Added Drives tab and functionality
JasmineRRod Jun 8, 2026
fd144f3
#61 SMART Data Display
JasmineRRod Jun 15, 2026
81b284a
#61 Draft SMART on Ubuntu
JasmineRRod Jun 22, 2026
347289c
Merge branch 'dev' into smart
JasmineRRod Jun 22, 2026
cacadb3
#61 Bundle smartctl 7.5 and polkit policy in fat DEB installer
jamesmarkchan Jun 28, 2026
669985e
#61 update readme
jamesmarkchan Jun 28, 2026
d7be92b
#61 remove enable guard of Run SMART button
jamesmarkchan Jun 28, 2026
aeefa48
#176 Smart changes made
JasmineRRod Jun 29, 2026
b5ce904
#176 Smart update for sorting
JasmineRRod Jun 29, 2026
39b9eac
Potential fix for pull request finding
JasmineRRod Jun 29, 2026
6d64c89
#176 use async solution w comments
jamesmarkchan Jun 29, 2026
88a7978
Potential fix for pull request finding
JasmineRRod Jun 29, 2026
5988ff1
#176 Smart JPA rollback handling
JasmineRRod Jun 29, 2026
20c9c68
Potential fix for pull request finding
JasmineRRod Jun 29, 2026
ccc6480
#176 Improved error handling
JasmineRRod Jun 29, 2026
6ad3eb4
#176 Smart initializing info
JasmineRRod Jun 29, 2026
1d1b7a5
#176 Removed comment
JasmineRRod Jun 29, 2026
88d9171
#176 panel default laf, linking benchmark tab on load
jamesmarkchan Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/linux-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Fetch bundled smartctl from jdm-deps
# Downloads the pre-packaged smartctl 7.5 binary from the public
# JDiskMark/jdm-deps release asset. The staging directory is picked
# up by jpackage --app-content (configured in jdm-deb/pom.xml) and
# lands at /opt/jdiskmark/smartctl/smartctl in the installed image.
run: |
curl -fsSL -o smartctl.tar.gz \
https://github.com/JDiskMark/jdm-deps/releases/download/tools%2Fsmartctl-7.5/smartctl-7.5-linux-x86_64.tar.gz
mkdir -p jdm-dist/jdm-deb/src/main/app-content
tar -xzf smartctl.tar.gz -C jdm-dist/jdm-deb/src/main/app-content
# Sanity check: binary must exist and be executable
test -x jdm-dist/jdm-deb/src/main/app-content/smartctl/smartctl
echo "smartctl staging OK:"
jdm-dist/jdm-deb/src/main/app-content/smartctl/smartctl --version || true

- name: Build Fat Debian Package
# -pl targets jdm-core and jdm-deb. -am also builds upstream dependencies.
# Explicitly activating the linux-deb profile to ensure jpackage runs.
Expand All @@ -52,6 +67,9 @@ jobs:
run: |
sudo dpkg -i jdm-dist/jdm-deb/target/*.deb || true
/opt/jdiskmark/bin/jdiskmark --help
# Verify bundled smartctl was installed correctly
test -x /opt/jdiskmark/smartctl/smartctl
/opt/jdiskmark/smartctl/smartctl --version

# --- FAT DEB COMPAT CHECK — verify the artifact installs on ubuntu-24.04 ---
# Downloads the artifact built above and smoke tests it on 24.04.
Expand Down
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sudo pkgutil --forget net.jdiskmark.JDiskMark
### Flatpak Installer (.flatpak)

The flatpak installer is a universal linux package that can be used on many distributions.
Some gaming-oriented distros such as Bazzite or SteamOS have Flatpak and Flathub
Some gaming-oriented distros such as Bazzite or SteamOS have Flatpak and Flathub
pre-configured.

#### 1. Add Flathub (if not already configured)
Expand Down Expand Up @@ -147,7 +147,7 @@ Java 25 to be installed separately.

## Launching as normal process

Note: Running without sudo or a windows administrator will require manually
Note: Running without sudo or a windows administrator will require manually
clearing the disk write cache before performing read benchmarks.

1. Open a terminal or shell in the extracted directory.
Expand All @@ -166,7 +166,7 @@ clearing the disk write cache before performing read benchmarks.

## Launching gui with elevated privileges

Note: Take advantage of automatic clearing of the disk cache for write read
Note: Take advantage of automatic clearing of the disk cache for write read
benchmarks start with sudo or an administrator windows shell.

- Linux: `sudo java -jar jdiskmark.jar`
Expand Down Expand Up @@ -295,6 +295,40 @@ JDiskMark is developed with [NetBeans 25](https://netbeans.apache.org/front/main
| Flatpak (Linux only) | `mvn clean install -pl jdm-core,jdm-dist/jdm-flatpak -am -Plinux-flatpak` |
| macOS PKG (macOS only) | `mvn clean install -pl jdm-core,jdm-dist/jdm-pkg -am -Pmacos-pkg` |

### SMART Feature Development (Linux)

The SMART tab uses `smartctl` to query drive health data via `pkexec` privilege
escalation. Two setup tiers are available depending on what you are testing:

**Tier 1 — Day-to-day development** (recommended for most contributors)

Install `smartmontools` from your system package manager:

```sh
sudo apt install smartmontools # Ubuntu / Debian
sudo dnf install smartmontools # Fedora / RHEL
```

The app will find `/usr/sbin/smartctl` automatically as a fallback.
The system version may be older than the bundled binary (7.2 on Ubuntu 22.04,
7.4 on Ubuntu 24.04) but is sufficient for testing all SMART code paths.

**Tier 2 — Integration / packaging testing**

Install the latest fat DEB artifact from CI
(`jdiskmark_<version>_amd64.deb`):

```sh
sudo dpkg -i jdiskmark_<version>_amd64.deb
```

This places the bundled `smartctl 7.5` binary at
`/opt/jdiskmark/smartctl/smartctl`. The app's path resolver
(`Smart.resolveSmartctlPath()`) finds it at that well-known path and uses it
automatically — even when running from the IDE. No `PATH` changes are needed.
This tier lets you test the exact runtime users will have after installing the
fat DEB.

### Pipeline triggered pre-release

## GitHub Actions
Expand Down
6 changes: 6 additions & 0 deletions jdm-core/src/main/java/jdiskmark/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ public static void loadProfile(BenchmarkProfile profile) {
writeSyncEnable = profile.isWriteSyncEnable();
sectorAlignment = profile.getSectorAlignment();
multiFile = profile.isMultiFile();
// Smart.smartEnable = profile.getEnableSmart();
} finally {
saveConfig();
}
Expand Down Expand Up @@ -644,6 +645,9 @@ public static void loadConfig() {

value = p.getProperty("multiFile", String.valueOf(multiFile));
multiFile = Boolean.parseBoolean(value);

value = p.getProperty("smartEnable", String.valueOf(Smart.smartEnable));
Smart.smartEnable = Boolean.parseBoolean(value);

value = p.getProperty("autoRemoveData", String.valueOf(autoRemoveData));
autoRemoveData = Boolean.parseBoolean(value);
Expand Down Expand Up @@ -742,6 +746,7 @@ public static void saveConfig() {
p.setProperty("profileModified", String.valueOf(profileModified));
p.setProperty("benchmarkType", benchmarkType.name());
p.setProperty("multiFile", String.valueOf(multiFile));
p.setProperty("smartEnable", String.valueOf(Smart.smartEnable));
p.setProperty("autoRemoveData", String.valueOf(autoRemoveData));
p.setProperty("autoReset", String.valueOf(autoReset));
p.setProperty("blockSequence", blockSequence.name());
Expand Down Expand Up @@ -814,6 +819,7 @@ public static String getConfigString() {
sb.append("writeTest: ").append(hasWriteOperation()).append('\n');
sb.append("locationDir: ").append(locationDir).append('\n');
sb.append("multiFile: ").append(multiFile).append('\n');

sb.append("autoRemoveData: ").append(autoRemoveData).append('\n');
sb.append("autoReset: ").append(autoReset).append('\n');
sb.append("blockSequence: ").append(blockSequence).append('\n');
Expand Down
9 changes: 8 additions & 1 deletion jdm-core/src/main/java/jdiskmark/BenchmarkRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ public Benchmark execute() throws Exception {
GcDetector.triggerAndWait(); // Initial cleanup
}

// Fetch SMART data before the benchmark starts (Linux only, non-fatal if it fails).
// Gui.runSmart() handles null/missing locationDir, dead privileged shell, and
// device-resolution failures internally — no risk of crashing the benchmark.
if (Smart.smartEnable && App.isLinux()) {
Gui.runSmart();
}

benchmark.recordStartTime();

// Execution Loops
Expand Down Expand Up @@ -330,4 +337,4 @@ private void mapEnvironment(Benchmark b, String model, String partId, DiskUsageI
b.driveInfo.usedGb = u.usedGb;
b.driveInfo.totalGb = u.totalGb;
}
}
}
Loading
Loading