Class OutputDirectoryStructure
java.lang.Object
de.cuioss.benchmarking.common.output.OutputDirectoryStructure
Manages the output directory structure for benchmark results.
Provides clear separation between deployable content (gh-pages-ready)
and non-deployable raw data (history, prometheus, wrk).
Directory structure:
benchmark-results/ ├── gh-pages-ready/ (deploymentDir, htmlDir) - All content deployable to GitHub Pages │ ├── data/ (dataDir) - JSON data files │ ├── badges/ (badgesDir) - Badge JSON files │ └── api/ (apiDir) - API endpoint JSON files ├── history/ (historyDir) - Historical archive data (NOT deployed) ├── prometheus/ (prometheusRawDir) - Raw Prometheus metrics (NOT deployed) └── wrk/ (wrkDir) - WRK raw results (NOT deployed)
-
Constructor Summary
ConstructorsConstructorDescriptionOutputDirectoryStructure(Path benchmarkResultsDir) Creates a new output directory structure. -
Method Summary
Modifier and TypeMethodDescriptionvoidCleans the deployment directory by deleting it and recreating it.voidEnsures deployment directories exist, creating them if necessary.Gets the history directory (benchmark-results/history).Gets the raw Prometheus metrics directory (benchmark-results/prometheus).Gets the WRK directory (benchmark-results/wrk).booleanChecks if the deployment directory exists.toString()
-
Constructor Details
-
OutputDirectoryStructure
Creates a new output directory structure.- Parameters:
benchmarkResultsDir- the root benchmark-results directory- Throws:
NullPointerException- if benchmarkResultsDir is null
-
-
Method Details
-
ensureDirectories
Ensures deployment directories exist, creating them if necessary. Non-deployed directories (history, prometheus, wrk) are created only when accessed.- Throws:
IOException- if directory creation fails
-
getHistoryDir
Gets the history directory (benchmark-results/history). Historical archive data should be stored in this directory. This directory is NOT deployed to GitHub Pages. Creates the directory if it doesn't exist.- Returns:
- the history directory path
- Throws:
IOException- if directory creation fails
-
getPrometheusRawDir
Gets the raw Prometheus metrics directory (benchmark-results/prometheus). Raw Prometheus data should be stored in this directory. This directory is NOT deployed to GitHub Pages. Creates the directory if it doesn't exist.- Returns:
- the raw Prometheus directory path
- Throws:
IOException- if directory creation fails
-
getWrkDir
Gets the WRK directory (benchmark-results/wrk). WRK raw results should be stored in this directory. This directory is NOT deployed to GitHub Pages. Creates the directory if it doesn't exist.- Returns:
- the WRK directory path
- Throws:
IOException- if directory creation fails
-
isDeploymentDirectoryExists
Checks if the deployment directory exists.- Returns:
- true if the deployment directory exists, false otherwise
-
cleanDeploymentDirectory
Cleans the deployment directory by deleting it and recreating it. This ensures a fresh start for report generation.- Throws:
IOException- if deletion or creation fails
-
toString
-