Skip to content

Commit 476c765

Browse files
committed
Fix endpoint paths from /heap to /allocs in documentation
The README and example code incorrectly referenced /debug/pprof/heap endpoints when they should be /debug/pprof/allocs. This commit updates all occurrences to use the correct endpoint path.
1 parent 196f26d commit 476c765

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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
8989
Then 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
9393
pprof -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]
118118
async 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

example/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)