diff options
Diffstat (limited to 'src/metrics.rs')
-rw-r--r-- | src/metrics.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/metrics.rs b/src/metrics.rs index d9ad372..16720f0 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -70,6 +70,11 @@ impl MetricsServer { debug!("{} {}", req.method(), req.uri()); let response = match (req.method(), req.uri().path()) { + (&Method::GET, "/hprof") => { + let buff = common_mem_prof::dump_profile().await.unwrap(); + tokio::fs::write("memdump.hprof", buff).await.unwrap(); + Response::builder().status(204).body(Body::from(vec![])).unwrap() + }, (&Method::GET, "/metrics") => { let mut buffer = vec![]; let encoder = TextEncoder::new(); |