jvm-profiling-tools / honest-profiler

A sampling JVM profiler without the safepoint sample bias
https://github.com/RichardWarburton/honest-profiler/wiki
MIT License
1.25k stars 146 forks source link

Feature Bundle #184

Closed PhRX closed 7 years ago

PhRX commented 7 years ago

This PR supersedes #173, which pretty much is obsoloete given the volume of changes.

It almost concludes the work I wanted to do. An overview of the changes can be found below.

Since the amount of code is probably larger again than what's in #173, reviewing isn't getting any easier. I'm aware of this. but IMHO having to wait for reviews should not hold up progressing on the project if the progress is on a large enough scale.

I'd like to propose the following procedure :

This way, we add an alternative standard for PR acceptance next to code review : enough users being happy as yardstick. Also, a branch on master is more visible than "just another fork".

Please let me know whether that works for y'all.

So, in addition to what's in #173, the following features have been added :

At code level, the following was changed :

Still to do, optionally :

RichardWarburton commented 7 years ago

Hi @PhRX ,

Thanks for continuing to work on this stuff. I don't really like the "approval" branch idea, sounds like it'll cause a lot more confusion. Better to just progress with the review. Since this PR is more advanced than the last one then I'm happy to have a go at reviewing this one. I propose we close #173 and focus on this one. What do you think?

PhRX commented 7 years ago

Thanks @chhsiao90 and @nitsanw for the review.

@RichardWarburton I forgot to reply, but I agree (and I already closed the old PR), although I'd like to do something about the visibility of the new stuff - a fork is in my (limited) experience very easily ignored entirely.

I'll finish up the documentation - only some utility classes are undocumented, and I'll probably write some package documentation which should make it clearer how the concepts work together - I can imagine that things like Grouping and Target may be a bit confusing or obscure when first coming across them. Some pictures or at least some text with a top-down explanation might clarify (comments in the code are by nature more bottom-up).

PhRX commented 7 years ago

To all potential reviewers : in my most recent commit I added the package description for the core.profiles.lean package.

I very very highly recommend reviewing it early on, since I tried to describe in detail the profiler basics, the internal structure of the LeanProfile data structure (which the core data structure on top of which all aggregations are built), and how the numerical data in there is (minimally) aggregated.

As a result, the text pretty accurately reflects many of my presumptions and assumptions when I wrote the code. Therefore, if there are any conceptual mistakes in this text, it is fairly certain that those mistakes are reflected in the code !

Unfortunately for me the converse is not true - if the text is accurate and sound, it doesn't mean the actual code is correct :-/

Of course an additional benefit of reading it is that the LeanProfile structure should be clearer afterwards.

RichardWarburton commented 7 years ago

Hi,

I've tried out the new JavaFX UI and in general it looks good. I like the multiple profile tabs and the comparison view - good improvements.

I've noticed a couple of things that look like regressions:

java.lang.StringIndexOutOfBoundsException: String index out of range: -11
    at java.lang.String.substring(String.java:1967)
    at com.insightfullogic.honest_profiler.core.sources.VirtualMachine.getLogSourceFromVmArgs(VirtualMachine.java:73)
    at com.insightfullogic.honest_profiler.ports.javafx.model.task.InitializeProfileTask.monitor(InitializeProfileTask.java:80)
    at com.insightfullogic.honest_profiler.ports.javafx.model.task.InitializeProfileTask.call(InitializeProfileTask.java:45)
    at com.insightfullogic.honest_profiler.ports.javafx.model.task.InitializeProfileTask.call(InitializeProfileTask.java:22)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
PhRX commented 7 years ago

Hi @RichardWarburton,

Thanks for the testing ! I addressed the 3 issues you mentioned :

PhRX commented 7 years ago

@RichardWarburton @chhsiao90 I was very focused on finishing the documentation yesterday, I didn't have time yet to remove the gradle bits (again). Will do so shortly.

@chhsiao90 and others : Is the landing page important ? Which functions or information would you like to see there ? It's not very difficult to reinstate but its functions have effectively been superseded by the menu options, and at the moment, once a profile has been opened, the landing page would never be seen again (because I haven't yet implemented any profile closing functions). That said, while mulling this yesterday I did realize the initial view looks a bit early 90s :-) (i.e. unwelcoming big blank area of nothing).

Suggestions and feedback more than welcome !

chhsiao90 commented 7 years ago

@PhRX - landing page is not very necessary and seems not import with this PR. I think keep empty in current version is fine :)

RichardWarburton commented 7 years ago

Hi @PhRX re: "Are you sure that you're running the latest version from the integration thread?" - I cloned a repo from your PR and used the compiled binary from that to produce the log. It was the latest commit as of the comment. I'll re-test this evening with your latest pushes into this PR.

PhRX commented 7 years ago

Hi @RichardWarburton I didn't even know you could clone from a PR. If you want me to, I can update the code to collect more information and make the Exception describe precisely what went wrong. I just re-eyeballed the current state and I don't see anything anymore that could cause trouble - either the agent was attached to the JVM with -agentPath + a logPath arg, in which case the file described by logPath will be returned, otherwise the old code is invoked.

Thanks for testing !

RichardWarburton commented 7 years ago

After both using the build of this for a while and talking to @nitsanw I've decided the best thing is to merge this PR and cleanup any remaining issues afterwards. But please, please, please send single-purpose PRs in future!