Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add profiling labels for pprof analysis#19232

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 4 commits intomainfromstevenmasley/profile_labels
Aug 7, 2025

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedAug 7, 2025
edited
Loading

PProf labels segment the code into groups for determing the source of cpu/memory profiles. Since the web server and background jobs share a lot of the same code (eg wsbuilder), it helps to know if the load is user induced, or background job based.

Example output:

# Using a 30s cpu sample$ go tool pprof"http://localhost:6060/debug/pprof/profile?seconds=30"(pprof) tags service: Total 390.0ms          310.0ms (79.49%): http-server           80.0ms (20.51%): terraform-provisioner

PProf labels segment the code into groups for determing the sourceof cpu/memory profiles. Since the web server and background jobsshare a lot of the same code (eg wsbuilder), it helps to knowif the load is user induced, or background job based.
@Emyrk
Copy link
MemberAuthor

Emyrk commentedAug 7, 2025
edited
Loading

I'm sure thepproflabel pkg api can be improved. Just want to test this out, and see how helpful it is. This is exploratory, and seeing what kind of code partitioning can happen in pyroscope to be helpful.

@EmyrkEmyrk marked this pull request as ready for reviewAugust 7, 2025 15:47
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

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

Only nits, this looks rad


api.AGPL.PrebuildsReconciler.Store(&reconciler)
goreconciler.Run(context.Background())
// TODO: Should this context be the app context?
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the "app" referring to here?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

api.ctx.

I just noticed the prebuild routine does not get the app context shutdown.

}

const (
ServiceTerraformProvisioner="terraform-provisioner"
Copy link
Contributor

Choose a reason for hiding this comment

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

Follow-up: would be cool to label pubsub as well.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Which pubsub? The database pubsub listeners?

func (p*PGPubsub)subscribeQueue(eventstring,newQ*msgQueue) (cancelfunc(),errerror) {

r.Use(
// TODO: @emyrk Should we standardize these in some other package?
httpmw.Recover(s.Logger),
httpmw.WithProfilingLabels,
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth discriminating on ws vs https traffic?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oh that is a really good idea. They should have that upgrade header iirc. Will add

Copy link
MemberAuthor

@EmyrkEmyrkAug 7, 2025
edited
Loading

Choose a reason for hiding this comment

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

@dannykopping

request_type: Total 730.0ms    550.0ms (75.34%): http    180.0ms (24.66%): websocketservice: Total 810.0ms    730.0ms (90.12%): http-api     80.0ms ( 9.88%): terraform-provisioner

@EmyrkEmyrk merged commit8ba8b4f intomainAug 7, 2025
26 checks passed
@EmyrkEmyrk deleted the stevenmasley/profile_labels branchAugust 7, 2025 16:21
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 7, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Emyrk@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp