nnethercote / dhat-rs

Heap profiling and ad hoc profiling for Rust programs.
Apache License 2.0
744 stars 36 forks source link

Dump JSON from profiler on demand #21

Open Noah-Kennedy opened 2 years ago

Noah-Kennedy commented 2 years ago

I recently was in a situation where I wanted to use dhat to grab the json blob from a process while it was running without stopping it or having it drop the profiler. It would be nice if I could use a method on the profiler to dump the json to a string on demand, as I could then use a signal handler or IPC call to dump the json output.