File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ async fn main() {
5757 }
5858
5959 let app = axum::Router::new()
60- .route("/debug/pprof/heap ", axum::routing::get(handle_get_heap));
60+ .route("/debug/pprof/allocs ", axum::routing::get(handle_get_heap));
6161
6262 // run our app with hyper, listening globally on port 3000
6363 let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
@@ -89,7 +89,7 @@ fn require_profiling_activated(prof_ctl: &jemalloc_pprof::JemallocProfCtl) -> Re
8989Then running the application, we can capture a profile and view it the pprof toolchain.
9090
9191``` shell
92- curl localhost:3000/debug/pprof/heap > heap.pb.gz
92+ curl localhost:3000/debug/pprof/allocs > heap.pb.gz
9393pprof -http=:8080 heap.pb.gz
9494```
9595
@@ -117,8 +117,8 @@ We can then adjust the example above to also emit a flamegraph SVG:
117117#[tokio::main]
118118async fn main() {
119119 let app = axum::Router::new()
120- .route("/debug/pprof/heap ", axum::routing::get(handle_get_heap))
121- .route("/debug/pprof/heap /flamegraph", axum::routing::get(handle_get_heap_flamegraph));
120+ .route("/debug/pprof/allocs ", axum::routing::get(handle_get_heap))
121+ .route("/debug/pprof/allocs /flamegraph", axum::routing::get(handle_get_heap_flamegraph));
122122 // ...
123123}
124124
Original file line number Diff line number Diff line change @@ -16,12 +16,12 @@ async fn main() {
1616 v. push ( i) ;
1717 }
1818
19- let app = axum:: Router :: new ( ) . route ( "/debug/pprof/heap " , axum:: routing:: get ( handle_get_heap) ) ;
19+ let app = axum:: Router :: new ( ) . route ( "/debug/pprof/allocs " , axum:: routing:: get ( handle_get_heap) ) ;
2020
2121 // Add a flamegraph SVG route if enabled via `cargo run -F flamegraph`.
2222 #[ cfg( feature = "flamegraph" ) ]
2323 let app = app. route (
24- "/debug/pprof/heap /flamegraph" ,
24+ "/debug/pprof/allocs /flamegraph" ,
2525 axum:: routing:: get ( handle_get_heap_flamegraph) ,
2626 ) ;
2727
You can’t perform that action at this time.
0 commit comments