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

Option --profiling-enabled #1417

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Option --profiling-enabled #1417

merged 1 commit into from
Nov 30, 2023

Conversation

olegbespalov
Copy link
Contributor

What?

It documents a new --profiling-enabled option from the https://github.com/grafana/k6/pull/3370/files.

Why?

This is a new option and it should be documented.

@olegbespalov olegbespalov added the Area: OSS Content Improvements or additions to community/oss documentation label Nov 17, 2023
@olegbespalov olegbespalov requested review from heitortsergent and a team November 17, 2023 08:29
@olegbespalov olegbespalov self-assigned this Nov 17, 2023
@olegbespalov olegbespalov requested review from oleiade and joanlopez and removed request for a team November 17, 2023 08:29
@olegbespalov olegbespalov mentioned this pull request Nov 23, 2023
48 tasks
@@ -904,6 +905,22 @@ export const options = {

{{< /code >}}

## Profiling Enabled

Enables [pprof](https://pkg.go.dev/net/http/pprof) profiling endpoints under the k6's REST API [address](#address). These endpoints help debug and profile k6 itself. k6's REST API should be enabled as well.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@olegbespalov I think this looks good, I just have one question here, what does "k6's REST API should be enabled as well" mean? Is that something the user needs to do as well for profiling to work?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it refers to this: https://k6.io/docs/misc/k6-rest-api/

However, the docs say: By default, that server listens on localhost:6565..., so I guess that comes by default, and just enabling profiling would be enough? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The point is that enabled REST API is required for the profiling endpoints. It's enabled by default but could be manually turned off; in that case, profiling endpoints won't be exposed. So, this sentence tries to document that case.

Copy link
Contributor

Choose a reason for hiding this comment

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

All good and clear to me :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gotcha, that makes sense. How would one manually turn that off? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pass an empty string like k6 run --address "" script.js

@olegbespalov olegbespalov merged commit b197428 into main Nov 30, 2023
6 checks passed
@olegbespalov olegbespalov deleted the feat/profiling-endpoints branch November 30, 2023 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: OSS Content Improvements or additions to community/oss documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants