This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Add query subcommand to profilecli for downloading pprof from phlare #475
Merged
cyriltovena
merged 3 commits into
grafana:main
from
simonswine:20230111_profilecli_query
Jan 17, 2023
Merged
Add query subcommand to profilecli for downloading pprof from phlare #475
cyriltovena
merged 3 commits into
grafana:main
from
simonswine:20230111_profilecli_query
Jan 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
simonswine
changed the title
20230111 profilecli query
Add query subcommand to profilecli for downloading pprof from phlare
Jan 11, 2023
simonswine
force-pushed
the
20230111_profilecli_query
branch
from
January 11, 2023 16:45
6c4a88b
to
db9adaf
Compare
Usage: ``` $ profilecli query merge --from now-5m --output pprof=my.pprof $ profilecli query merge --from now-5m --profile-type memory:alloc_space:bytes:space:bytes &googlev1.Profile{ SampleType: []*googlev1.ValueType{ &googlev1.ValueType{ Type: 1, Unit: 2, }, }, [...] DropFrames: 0, KeepFrames: 0, TimeNanos: 1673453999823000000, DurationNanos: 300000000000, PeriodType: &googlev1.ValueType{ Type: 434, Unit: 2, }, Period: 524288, Comment: []int64(nil), DefaultSampleType: 1, } ```
Previous output is available with --output=raw
simonswine
force-pushed
the
20230111_profilecli_query
branch
from
January 12, 2023 09:35
39220f8
to
72a274b
Compare
simonswine
commented
Jan 12, 2023
cmd/profilecli/query.go
Outdated
return errors.Wrap(err, "failed to marshal protobuf") | ||
} | ||
|
||
err = os.WriteFile(filePath, buf, 0644) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should gzip it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes pprof should be gziped
cyriltovena
approved these changes
Jan 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if you can add the gzip.
This will also change the behaviour, when create a pprof file, it will fail when the file already exists.
simonswine
added a commit
to simonswine/pyroscope
that referenced
this pull request
Jun 30, 2023
…rafana/phlare#475) * Add query subcommand to download pprof from phlare Usage: ``` $ profilecli query merge --from now-5m --output pprof=my.pprof $ profilecli query merge --from now-5m --profile-type memory:alloc_space:bytes:space:bytes &googlev1.Profile{ SampleType: []*googlev1.ValueType{ &googlev1.ValueType{ Type: 1, Unit: 2, }, }, [...] DropFrames: 0, KeepFrames: 0, TimeNanos: 1673453999823000000, DurationNanos: 300000000000, PeriodType: &googlev1.ValueType{ Type: 434, Unit: 2, }, Period: 524288, Comment: []int64(nil), DefaultSampleType: 1, } ``` * Use parsed profile output for console by default Previous output is available with --output=raw * Implement gzip compression for pprof file This will also change the behaviour, when create a pprof file, it will fail when the file already exists.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a query subcommand to download pprof from phlare using profilecli.
This is on top of #474
Usage: