11 stable releases
3.0.1 | Mar 8, 2022 |
---|---|
3.0.0 | Nov 24, 2021 |
2.0.4 | Jan 28, 2021 |
1.0.3 | Jan 16, 2021 |
#49 in Profiling
369,737 downloads per month
Used in 843 crates
(11 directly)
13KB
256 lines
A library to quickly get the live/total/max counts of allocated instances.
#[derive(Default)]
struct Widget {
_c: countme::Count<Self>,
...
}
let w1 = Widget::default();
let w2 = Widget::default();
let w3 = Widget::default();
drop(w1);
let counts = countme::get::<Widget>();
assert_eq!(counts.live, 2);
assert_eq!(counts.max_live, 3);
assert_eq!(counts.total, 3);
eprintln!("{}", countme::get_all());
Dependencies
~0–4.5MB