https://github.com/aalexand/pprof-upload
Upload a performance profile in pprof format to Stackdriver Profiler UI for visualization
https://github.com/aalexand/pprof-upload
performance performance-analysis pprof
Last synced: 9 months ago
JSON representation
Upload a performance profile in pprof format to Stackdriver Profiler UI for visualization
- Host: GitHub
- URL: https://github.com/aalexand/pprof-upload
- Owner: aalexand
- License: apache-2.0
- Created: 2019-01-16T06:43:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-11T21:27:24.000Z (over 6 years ago)
- Last Synced: 2025-04-11T16:16:15.712Z (about 1 year ago)
- Topics: performance, performance-analysis, pprof
- Language: Go
- Homepage:
- Size: 222 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pprof-upload
Binary `pprof-upload` uploads a performance profile in pprof format to
[Stackdriver Profiler UI](https://cloud.google.com/profiler/docs/using-profiler)
for visualization.
## Installation
[Download and install](https://golang.org/doc/install) Go, then run command
```
go get github.com/aalexand/pprof-upload
```
Add your `$GOPATH/bin` to `$PATH` for convenience.
## Usage
You'll need a Google Cloud Platform project to upload and visualize the
profiling data. You can use an existing project you have, or [create a new
one](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
Note the project ID, you'll need it in the upload command.
Make sure the project has the [profiler API
enabled](https://cloud.google.com/profiler/docs/profiling-go#enabling-profiler-api).
Once the prerequisites are completed, run command like:
```
pprof-upload -project_id=your-project-id ~/path/to/profile.pb.gz
```
The command will upload the profile and print out a URL that can be visited to
view the data. You should see something like

You can pass more than one profile path to the tool:
```
pprof-upload -project_id=your-project-id ~/path/*.pg.gz
```
In that case the profiles will be merged before being uploaded. The profiles
must be merge-compatible - have the same profile type (e.g. `heap` vs. `cpu`)
and set of metrics. You can also disable the merge like:
```
pprof-upload -merge=false -project_id=your-project-id ~/path/*.pg.gz
```
The profiles must still be merge-compatible but will be uploaded individually
such that the merge will only be done at the viewing time. This is rarely needed
and the main benefit is the ability to use the weight filter in the profiler UI.
Note that Stackdriver Profiler stores data for 30 days, so the profile will be
gone after about a month.
See also [Stackdriver Profiler
quickstart](https://cloud.google.com/profiler/docs/quickstart) on how to enable
continuous production profiling for a service running on Google Cloud Platform.