From e56a81c8fd25836ba800acd6e6e262513fe1dea1 Mon Sep 17 00:00:00 2001 From: Lars Quentin Date: Sun, 21 Jan 2024 16:45:36 +0100 Subject: [PATCH] create workfspace structre --- Cargo.toml | 14 ++++---- README.md | 60 ++++++++++++++++++++++++++++++++ blackheap-analyzer/Cargo.toml | 8 +++++ blackheap-analyzer/src/lib.rs | 14 ++++++++ blackheap-benchmarker/Cargo.toml | 8 +++++ blackheap-benchmarker/src/lib.rs | 14 ++++++++ blackheap-core/Cargo.toml | 8 +++++ blackheap-core/src/lib.rs | 14 ++++++++ blackheap/Cargo.toml | 12 +++++++ {src => blackheap/src}/main.rs | 1 - 10 files changed, 146 insertions(+), 7 deletions(-) create mode 100644 README.md create mode 100644 blackheap-analyzer/Cargo.toml create mode 100644 blackheap-analyzer/src/lib.rs create mode 100644 blackheap-benchmarker/Cargo.toml create mode 100644 blackheap-benchmarker/src/lib.rs create mode 100644 blackheap-core/Cargo.toml create mode 100644 blackheap-core/src/lib.rs create mode 100644 blackheap/Cargo.toml rename {src => blackheap/src}/main.rs (99%) diff --git a/Cargo.toml b/Cargo.toml index 968945d..c989cad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,10 @@ -[package] -name = "blackheap" -version = "0.1.0" -edition = "2021" +[workspace] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +members = [ + "blackheap", + "blackheap-benchmarker", + "blackheap-core", + "blackheap-analyzer" +] -[dependencies] +resolver = "2" diff --git a/README.md b/README.md new file mode 100644 index 0000000..fa0a0fe --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# Blackheap + +This tool creates a performance model of your I/O speed and further allows to predict future preformance. + +## Note + +There is a **big recode** right now. But how does one eat an elephant... + +## Progress +- [x] Start new repo +- [ ] Requirements Engineering + - [x] Find out how to formalize what the code should do + - fuck formalization, we use pseudocode + - [ ] Look what the code did before by looking through... + - [ ] + - [ ] + - [ ] `blackheap-benchmark` + - [ ] `blackheap-modeller` + - [ ] `blackheap-frontend` + - [ ] `preloadee` + - [ ] All open issues + - [ ] All closed isses + - Unstructured ideas: + - Has to be resumeable + - be able to re-analyze raw data again + - Provide machine generated README in the data +- [ ] Design a high level architecture based on the requirements +- [ ] Start writing the benchmarker + - [ ] Figure out how C/Rust interop work with a simple test (do some computations in C, test in Rust) + - [ ] +- [ ] ... + +- [ ] rewrite docs + - [ ] Check whether there was some information in the old docs that is lost + +## Architecture +Cargo workspace with the following crates +``` +- blackheap-core (lib): stuff all other libraries need (like Definitions) +- blackheap-benchmarker (lib): C code with Rust wrapper +- blackheap-analyzer (lib): Analysis of the benchmarks +- blackheap (bin): The user facing code +``` + +High level workflow: +``` +- user starts blackheap with config parameters +- blackheap checks which benchmarks are already done + - If folder doesnt exist / was not provided, do all benchmarks +- based on those benchmarks, do the analysis +- Create (human-readable) plots +- Create (machine-readable) parsing data +``` + +Benchmarker: +``` +- get input from Rust struct +- give output in Rust struct +- Rust part should support a to json function for persistence +``` diff --git a/blackheap-analyzer/Cargo.toml b/blackheap-analyzer/Cargo.toml new file mode 100644 index 0000000..5c4100d --- /dev/null +++ b/blackheap-analyzer/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "blackheap-analyzer" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/blackheap-analyzer/src/lib.rs b/blackheap-analyzer/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/blackheap-analyzer/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/blackheap-benchmarker/Cargo.toml b/blackheap-benchmarker/Cargo.toml new file mode 100644 index 0000000..1de56b0 --- /dev/null +++ b/blackheap-benchmarker/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "blackheap-benchmarker" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/blackheap-benchmarker/src/lib.rs b/blackheap-benchmarker/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/blackheap-benchmarker/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/blackheap-core/Cargo.toml b/blackheap-core/Cargo.toml new file mode 100644 index 0000000..a2bee95 --- /dev/null +++ b/blackheap-core/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "blackheap-core" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/blackheap-core/src/lib.rs b/blackheap-core/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/blackheap-core/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/blackheap/Cargo.toml b/blackheap/Cargo.toml new file mode 100644 index 0000000..2baa5ac --- /dev/null +++ b/blackheap/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "blackheap" +version = "0.1.0" +edition = "2021" +description = "An blackbox approach to I/O modelling." +homepage = "https://github.com/lquenti/blackheap" +repository = "https://github.com/lquenti/blackheap" +license = "MIT" +authors = ["Lars Quentin "] +readme = "./README.md" + +[dependencies] diff --git a/src/main.rs b/blackheap/src/main.rs similarity index 99% rename from src/main.rs rename to blackheap/src/main.rs index c37fcc1..fc00573 100644 --- a/src/main.rs +++ b/blackheap/src/main.rs @@ -9,4 +9,3 @@ mod tests { assert_eq!(2 + 2, 4); } } -