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: client side pprof merging for cumulative types #24

Merged
merged 15 commits into from
Dec 16, 2022

Conversation

korniltsev
Copy link
Collaborator

No description provided.

@korniltsev korniltsev marked this pull request as draft November 30, 2022 10:33
@korniltsev korniltsev force-pushed the feat/clientside_pprof_merging branch from 38bde26 to b9385f9 Compare November 30, 2022 10:36
@korniltsev
Copy link
Collaborator Author

hmm, pprof module requires Go 1.18
should we vendor it and make it 1.15 compatible?

Copy link
Contributor

@kolesnikovae kolesnikovae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

internal/cumulative/cumulative.go Outdated Show resolved Hide resolved
internal/cumulative/cumulative.go Outdated Show resolved Hide resolved
@kolesnikovae
Copy link
Contributor

I think that vendoring/forking pprof package exclusively to support 1.15 (which is not supported officially already) might be redundant


// todo should we disableClientSideMerge if we fail to merge or keep trying?
// todo should we filter by enabled ps.profileTypes to reduce profile size ? maybe add a separate option ?
func (m *ProfileMerger) Merge(j *upstream.UploadJob) error {
Copy link
Member

@petethepig petethepig Dec 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One potential issue with this code is that it is using the prev field of the ProfileMerger struct to store the previous profile. However, it is not clear from the code provided how this field is being initialized or whether it is being reset after each call to the Merge function. This could potentially cause issues if the prev field is not being properly initialized or reset, as it could lead to unexpected behavior when merging profiles.

Additionally, the code is using the defer keyword to print a message to the console after the Merge function has completed. This is indicated by the comment //todo remove before merge. It is generally a good idea to remove any debug code (such as this defer statement) before merging your code, as it can cause unexpected behavior and make it difficult to understand and debug your code.

Finally, the code is using the fmt.Printf function to print a message to the console. This function should not be used in production code, as it is intended for debugging purposes only. In production code, it is generally a better idea to use a logging library (such as the standard log package) to log messages. This allows you to easily control the log level and output location, which can be useful for debugging and monitoring your application.


(I didn't write it, ChatGPT did)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not resolving for lulz

@petethepig petethepig merged commit b18fe83 into main Dec 16, 2022
@petethepig petethepig deleted the feat/clientside_pprof_merging branch December 16, 2022 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants