diff options
author | Aleksey Kladov <[email protected]> | 2021-01-21 16:04:50 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-21 16:30:52 +0000 |
commit | e5c5c0a040e0c74892ea0a36c7fd50e5410879bd (patch) | |
tree | 4da6406b6d85f884b5ee2c927b2c1126192a9159 /crates/profile/src/hprof.rs | |
parent | 235583f3fc886bb839f34c4ff5713d101939d95c (diff) |
Include `countme` crate to count important data structures.
Diffstat (limited to 'crates/profile/src/hprof.rs')
-rw-r--r-- | crates/profile/src/hprof.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/profile/src/hprof.rs b/crates/profile/src/hprof.rs index 8957ea016..29d2ed518 100644 --- a/crates/profile/src/hprof.rs +++ b/crates/profile/src/hprof.rs | |||
@@ -3,6 +3,7 @@ use once_cell::sync::Lazy; | |||
3 | use std::{ | 3 | use std::{ |
4 | cell::RefCell, | 4 | cell::RefCell, |
5 | collections::{BTreeMap, HashSet}, | 5 | collections::{BTreeMap, HashSet}, |
6 | env, | ||
6 | io::{stderr, Write}, | 7 | io::{stderr, Write}, |
7 | sync::{ | 8 | sync::{ |
8 | atomic::{AtomicBool, Ordering}, | 9 | atomic::{AtomicBool, Ordering}, |
@@ -18,7 +19,8 @@ use crate::tree::{Idx, Tree}; | |||
18 | /// env RA_PROFILE=foo|bar|baz // enabled only selected entries | 19 | /// env RA_PROFILE=foo|bar|baz // enabled only selected entries |
19 | /// env RA_PROFILE=*@3>10 // dump everything, up to depth 3, if it takes more than 10 ms | 20 | /// env RA_PROFILE=*@3>10 // dump everything, up to depth 3, if it takes more than 10 ms |
20 | pub fn init() { | 21 | pub fn init() { |
21 | let spec = std::env::var("RA_PROFILE").unwrap_or_default(); | 22 | countme::enable(env::var("RA_COUNT").is_ok()); |
23 | let spec = env::var("RA_PROFILE").unwrap_or_default(); | ||
22 | init_from(&spec); | 24 | init_from(&spec); |
23 | } | 25 | } |
24 | 26 | ||