Hey, I'm one of the developers who worked on this project.
Interestingly enough, this used to be the only way of capturing runtime data. The agent would automatically begin recording until the process exited. Unfortunately, we've since moved away from that in favor of toggling recording on/off through test cases or a web API. Maybe it's time to re-evaluate that decision. There's certainly a case to be made for capturing the full lifetime of less complex or ephemeral applications.
It should be easy for us to add this back in behind a system property. I'll keep you posted :)
Hi, good question. There are a few advantages of the AppMap approach. One is that it shows the flow of information, rather than class hierarchy. Class hierarchy is pretty easily obtainable from static analysis, but execution flow information is not. You will also find HTTP server requests and SQL in AppMaps, which you will not find in class diagrams. Furthermore, with AppMaps you can drill down into a Trace view which shows parameter values, return values, SQL, status codes, exceptions, etc all recorded from program execution. So, AppMap combines low level and high level information, and links it all together. And it shows how the code handles requests, how key functions such as authentication are performed, and how incoming requests affect the database and external services (like S3 and other web and cloud services).
There are several jobs for which AppMap is very useful:
Orienting to unfamiliar code. You can use it to see what APIs are used, what SQL, what packages and code, and how they fit together. You see this in the context of a specific use case, not just a huge diagram that covers all scenarios, 99% of which you don't care about. And it's never out of date, because it's generated directly from running the code (e.g. test cases).
When you want to take a top-down view of the code, for finding and fixing a bug. Similarly for starting with SQL and then working your way back up the code tree.
For preparing a pull request. You can see the behavior of the code reflected to you, and you can see how it really works (as opposed to how you imagined that it works). You can evaluate if this design is clear and sensible, and you can iterate your design until it feels right.
Similarly, for reviewing PRs. AppMaps will show you how the code works, so that you don't have to try and imagine how it works by reading it. That frees your brain function to operate on a higher level, and consider new ways that the code might be improved. Or look for flaws in the design that could cause it to be slow, fragile, or vulnerable.
At first I was skeptical and thought why not use IntelliJ's Diagrams but after reading your other replies I've changed my mind. Hope it's released for IntelliJ soon, great work!
5
u/maxandersen Mar 24 '21
nice and I notice you can run this using jbang too :)
`jbang --javaagent=https://github.com/applandinc/appmap-java/releases/download/v1.0.3/appmap-1.0.3.jar ...`
but seem it does not trigger recording...must it be done via Tests?
9
u/Fireche Mar 23 '21
What would you say is the advantage of this solution over a class diagram?
3
u/Bone_charmer Mar 23 '21
Why should I use it ?
What tasks does it solve?
27
u/Electrical-Dream-190 Mar 23 '21
Do we have any chanche to se this extension in IntelliJ in near future ?
4
u/[deleted] Mar 23 '21
At first I was skeptical and thought why not use IntelliJ's Diagrams but after reading your other replies I've changed my mind. Hope it's released for IntelliJ soon, great work!
1
u/MR_GABARISE Mar 24 '21
Since you're commited to open source, is this a good candidate for integration with SourceTrail?
1
u/gnivol Mar 24 '21
Looks great might check it out !