Skip to content

Added section about async profiler with cf java #1771

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

davidhunglam
Copy link
Contributor

Added section about how to use the https://github.com/SAP/cf-cli-java-plugin to run profiling with asprof.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Spelling Mistakes

  • java/operating-applications/optimizing.md:56:8 Unknown word "Asprof"
  • java/operating-applications/optimizing.md:57:34 Unknown word "asprof"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.

Choosing an output filename with .html ending indicates to use the output type `flamegraph`, see [FlameGraph visualization](https://github.com/async-profiler/async-profiler/blob/master/docs/GettingStarted.md#flamegraph-visualization)
:::

`.html` files can be opened in a browser, `.jfr` files can be viewed with a viewer such as [OpenJDK Mission Control](https://openjdk.org/projects/jmc/).
Copy link
Contributor

Choose a reason for hiding this comment

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

can jfr files also be opened in intellij or vscode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In IntelliJ only with the Ultimate Edition. For VSCode I'm not aware of any extension that could open jfr files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Johannes hat ein PLugin für intellij gebaut - nur das ist eher noch instabil. Du kannst ihn ja fragen, ob wir es schon verlinken sollen

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Linting Errors

  • java/operating-applications/optimizing.md:73 Fenced code blocks should have a language specified
  • java/operating-applications/optimizing.md:78 Fenced code blocks should have a language specified
  • java/operating-applications/optimizing.md:83 Fenced code blocks should have a language specified
  • java/operating-applications/optimizing.md:88 Fenced code blocks should have a language specified
  • java/operating-applications/optimizing.md:93 Fenced code blocks should have a language specified
  • java/operating-applications/optimizing.md:98 Fenced code blocks should have a language specified
  • java/operating-applications/optimizing.md:103 Fenced code blocks should have a language specified

Copy link
Contributor

@BraunMatthias BraunMatthias left a comment

Choose a reason for hiding this comment

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

nice docu - exactly what is required

@davidhunglam
Copy link
Contributor Author

@renejeglinsky, @smahati, we still need a review from one of you. We'd like to have this merged before the upcoming CAP Java release.


#### Async Profiler

Using `cf java` to profile Java applications running on Cloud Foundry with the [Async Profiler](https://github.com/async-profiler/async-profiler?tab=readme-ov-file#async-profiler) requires **recent versions** of the **SAP Java Buildpack with SAPMachine 17** (`1.110.0`) and **21** (`2.24.0`).
Copy link
Contributor

Choose a reason for hiding this comment

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

How do I ensure this? Does our tooling (cds add mta) define a buildpack that fulfills this requirement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes cds add mta fulfills this. It does not declare a specific version for the buildpack, and then the latest release is used which includes the aysnc-profiler. So unless you manually change the versioning, you'll meet the requirement.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that should be mentioned in the async-profiler readme as well (and then we could just mention and link ;) )
Shall we make a contribution for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but I honestly think their readme is worse and has too much clutter for our target audience.

Comment on lines 72 to 74
```txt
Start an async-profiler CPU-time profile recording on a running Java application
```
Copy link
Contributor

Choose a reason for hiding this comment

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

This an unusual pattern. Why did you decide for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personal choice, as it's similar to what I get as output when I use the help of the cf java CLI. But we can change this, if there's a better pattern.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand. As we're not positioning this as help text from the CLI (then we would need to make sure that it's always up to date) we can use just normal text. Agreed? I'll do the change then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants