Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add HTTP API for cpu profiling #1694

Merged
merged 15 commits into from
Jun 7, 2023
Prev Previous commit
Next Next commit
feat: update readme
evenyag committed Jun 5, 2023
commit 00aec2449e4d930e20e358202c425665cd371313
7 changes: 6 additions & 1 deletion src/common/pprof/README.md
Original file line number Diff line number Diff line change
@@ -7,11 +7,16 @@ cargo build --features=pprof
```

## HTTP API
Sample at 99 Hertz, for 5 seconds, output report in protobuf format.
Sample at 99 Hertz, for 5 seconds, output report in [protobuf format](https://github.com/google/pprof/blob/master/proto/profile.proto).
```bash
curl -s '0:4000/v1/prof/cpu' > /tmp/pprof.out
```

Then you can use `pprof` command with the protobuf file.
```bash
go tool pprof -top /tmp/pprof.out
```

Sample at 99 Hertz, for 60 seconds, output report in flamegraph format.
```bash
curl -s '0:4000/v1/prof/cpu?seconds=60&output=flamegraph' > /tmp/pprof.svg