Skip to content

Commit b368ccc

Browse files
committed
Create tools dir
1 parent e8a8d36 commit b368ccc

5 files changed

Lines changed: 28 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ jobs:
105105
with:
106106
command: clippy
107107
args: -- -D warnings
108+
- name: Install dependencies for tools
109+
run: sudo apt-get -y install libfontconfig1-dev jq
110+
- name: Check tools
111+
working-directory: tools
112+
run: cargo clippy -- -D warnings
108113

109114
miri:
110115
runs-on: ubuntu-latest

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/target
2-
/Cargo.lock
3-
cache_memory_used.png
1+
**/target
2+
**/Cargo.lock
3+
**/cache_memory_used.png

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ criterion = "0.7"
2929
rand = { version = "0.9", features = ["small_rng"] }
3030
rand_distr = "0.5"
3131
tokio = { version = "1", features = ["full"] }
32-
memory-stats = { version = "1.2.0" }
33-
plotters = { version = "0.3" }
3432

3533
[[bench]]
3634
name = "benchmarks"

tools/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "memory_used_plot"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[[bin]]
8+
name = "memory_used_plot"
9+
path = "src/memory_used_plot.rs"
10+
11+
[dependencies]
12+
quick_cache = { path = ".." }
13+
memory-stats = "1.2.0"
14+
plotters = "0.3"
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn main() {
3838
println!("{:?}", memory_data);
3939
memory_datas.push(memory_data);
4040
}
41-
let key: Key = (n as u128).to_le_bytes().into();
41+
let key: Key = (n as u128).to_le_bytes();
4242
cache.insert(key, ());
4343
}
4444

@@ -62,8 +62,9 @@ fn main() {
6262
let mut chart = ChartBuilder::on(&root)
6363
.caption(
6464
format!(
65-
"Memory Used ({})",
66-
format!("{}(cap={})", type_name_of_val(&cache), cache_capacity)
65+
"Memory Used ({}(cap={}))",
66+
type_name_of_val(&cache),
67+
cache_capacity
6768
),
6869
("sans-serif", 60),
6970
)
@@ -104,8 +105,8 @@ fn main() {
104105

105106
chart
106107
.configure_series_labels()
107-
.background_style(&WHITE.mix(0.8))
108-
.border_style(&BLACK)
108+
.background_style(WHITE.mix(0.8))
109+
.border_style(BLACK)
109110
.label_font(("sans-serif", 20))
110111
.legend_area_size(60)
111112
.draw()

0 commit comments

Comments
 (0)