A small Java project with a Python launcher. This file can be used for presentations or as a README.
A Swing application that displays mock system samples (CPU, Memory, Disk, Temperature, Network), calculates averages, and exports them to a CSV file. A Python launcher helps compile/run the app and logs launch timestamps.
-
src/main/java/svc/Main.java— GUI entry point (svc.Main) -
src/main/java/svc/MainFrame.java— Main window and UI (svc.MainFrame) -
src/main/java/svc/SystemMonitor.java— Periodic sample generation (svc.SystemMonitor)- Includes inner class
SystemSample
- Includes inner class
-
src/main/java/svc/MetricsCollector.java— Sample aggregation and analysis -
src/main/java/svc/UIUtils.java— UI helper components (buttons, progress bars, formatting) -
src/main/java/svc/CsvExporter.java— Export averaged metrics to CSV and summary file
-
python/app.py— Java compile/run launcher and startup logger- Contains important constants such as
MAIN_CLASS,JAVA_SRC_DIR,BUILD_DIR
- Contains important constants such as
-
python/launcher_history.jsonl— Timestamp log of each launch
.gitignore— Ignores build output, logs, and temporary files
-
The Python launcher records the launch time in
launcher_history.jsonl. -
If
javacis available,app.pycompiles all.javafiles fromJAVA_SRC_DIRintoBUILD_DIR. -
The launcher starts the Java app using:
java -cp out svc.Main
-
The UI (
MainFrame) displays mock system samples generated bySystemMonitorand stores them inMetricsCollector. -
The user can export the current snapshot via
CsvExporterto a CSV file (default:export_history.csv).
python python/app.pyjavac -d out $(find src/main/java -name '*.java')
java -cp out svc.Main(On Windows, list all .java files explicitly in the javac command.)
-
Clear separation of concerns:
- Sampling →
SystemMonitor - Aggregation/Analysis →
MetricsCollector - UI →
MainFrame/UIUtils - Export →
CsvExporter
- Sampling →
-
Python launcher allows running the project without an IDE and keeps a launch history.
-
CSV output contains averaged metrics and can be opened in Excel or other analysis tools.
src/main/java/svc/Main.javasrc/main/java/svc/MainFrame.javasrc/main/java/svc/SystemMonitor.javasrc/main/java/svc/MetricsCollector.javasrc/main/java/svc/UIUtils.javasrc/main/java/svc/CsvExporter.javapython/app.pypython/launcher_history.jsonl.gitignore
javac -d out -sourcepath src\main\java src\main\java\svc\*.javajava -cp out svc.Main