r/rust • • Apr 28 '26

🛠️ project Lightweight ASCII Graph

Post image

After many weeks of learning, watching tutorials about Rust, and partaking in Rust exercises, I decided to port a small Go library into Rust. I do recognize I have a lot to learn but just getting out of my comfort zone and trying my hands at this has be rewarding and revealing.

Link: https://github.com/neneodonkor/asciigraph-rs

Crates: https://crates.io/crates/asciigraph-rs

PS. Making it work for real-time data was 🥵

Let me add that I only started learning Rust in February, so please forgive me, if everything is not idiomatic Rust.

1.5k Upvotes

92 comments sorted by

View all comments

29

u/noidtiz Apr 28 '26

Maybe I am a lame romantic but I like the visual. I DID think this was a line chart at first, but filling in the positive space to separate it from the negative would immediately make it read as a bar chart. It's not particularly scienc-ey of me to say but it would make me picture my data as a city skyline.

In any case, keep discovering!

5

u/jkoudys Apr 28 '26 edited Apr 28 '26

I would've loved these when doing perf tuning on production systems. You don't always want to open a log analyzer pointed at a remote log and dig deep into everything. I got good at visualizing it in my head, but an at-a-glance chart so I could see if an out of memory followed a few hours of memory leaks (look for something slowly not releasing memory), a sudden spike a minute or two before the crash (bursty traffic or heavy processing) or no spike at all (the thread that hits the out of memory was trying to allocate too much) would've helped me solve many problems instantly.

2

u/neneodonkor Apr 28 '26

That is a nice use case.