r/java • u/kgilpin72 • May 13 '21
Visualize the architecture of your Java app, in IntelliJ, in 2 ¹/₂ minutes
7
u/GlensWooer May 13 '21
How's this standup in an old enterprise codebase? I may try to see if this provides any value but if anyone has input to that it's not great on old code with poor coverage I'll save my time.
11
u/kgilpin72 May 13 '21
Hi, if your app doesn't have much code coverage, and it's a web app, then there is a better option for recording AppMaps that doesn't require test cases. We call it "remote recording". Instead of running test cases, you do the following:
Run your app with the AppMap agent loaded
Send it a command via HTTP to start recording
Interact with the app manually (e.g. use the UI)
Send another HTTP command to stop recording, and save the AppMap file
Open it in IntelliJ
Here's further information on how it works:
If the code base is very large, here's a guide for pruning the AppMaps by excluding irrelevant code - https://github.com/applandinc/appland-cli/blob/master/doc/refine-appmaps.md
Using these techniques, AppMap has been used on some substantially large and old projects; 25 years old with 10MM lines of code.
Contact us in Discord if you want any more assistance - thanks for your question.
10
u/benevanstech May 13 '21
I've not tried it out, but I suspect my dear friend, and favourite antipattern, "Easy Cases Are Easy" will be making an appearance here.
5
u/ptrdvrk May 13 '21 edited May 13 '21
Hi, I am with the AppMap team. Can you describe the level of code complexity that you would like to see mapped with AppMap? Please join us on Discord and we will be happy to assist you: https://discord.com/invite/N9VUap6
As u/kgilpin72 mentioned above, AppMap has been used on substantial Java projects, including one that has been around for 25 years with over 10millions lines of code and thousands of end-to-end integrations tests.
6
u/benevanstech May 14 '21
I think a video of showing how it works on a large, complex OSS codebase would be insightful - maybe something like the Eclipse Collections.
And, please forgive my slight skepticism. This isn't the first, or even the twentieth, GUI tool for visualizing code that I've encountered in my career, and I've never seen *anything* that was useful at real scale.
1
u/ptrdvrk May 14 '21
This is good feedback, thank you. I (obviously) highly recommend that you try it with your code base. The "2 1/2 minutes" video is intentionally simple, here is a more complex example showcasing an AppMap recorded for one of the ~3,000 tests of a very popular e-commerce platform called Solidus: https://appland.com/videos/2021/04/06/get-productive-on-an-unfamiliar-codebase-quickly-with-appmap-for-visual-studio-code/
Or, check out our online gallery of examples - we have mapped a few dozens of popular OSS projects, including Solidus. This particular AppMap was recorded from a test that covers handling of images of merchandise:
https://app.land/scenarios/314ff7a8-02a8-4f34-b2cf-f2d8803897a9
Side note: app.land is a cloud AppMap service - a repository for hosting and analysis of AppMaps, currently in an open preview.
1
u/benevanstech May 14 '21
Thanks for responding. I hope that you understand that, no disrespect to you or your product, but the space that you're in - older developers like myself have seen a large number of tools that have over-promised and under-delivered.
So, yes: "Try it out for yourself" is fine, but my time isn't free. Videos or other materials that show your tool working on an OSS codebase of considerable complexity are hugely valuable. Just saying "we're different" is fine - but I've seen a dozen tools that said that, and couldn't cut it when it came to production deployments.
2
u/MR_GABARISE May 13 '21
Is see there are endpoints for typical web apps. What if I want to start tracking programmatically? Ex. We have fairly involved legacy integration tests where a lot of setup involves code that would otherwise be traced. Could we filter them out by way of some programmatic start/stop API we'd enable only around the actual "studied" code?
4
u/kgilpin72 May 13 '21
Yes. Basically you can start and stop recording by sending a command to the AppMap agent over HTTP. So, you would start your test, let it do the setup work, then send a start command, run the rest of the test, and then send the stop command. Here’s a doc for that, and you can also find some additional info in the appmap-java repo on GitHub - https://appland.com/docs/recording-methods.html#simple-remote-recording
It’s easy to try this out using curl. You can use the same approach to record manual interaction with the app.
1
u/MR_GABARISE May 13 '21
I was in fact talking about running tests locally. And in our case it's a Camel + Spring batch application with no web capability.
Which brings another interesting question : do you integrate with, or plan to integrate with Camel?
3
u/kgilpin72 May 13 '21
Ok that’s a little easier. Use Recorder.instance with https://github.com/applandinc/appmap-java/blob/960b068c23fc9e83dfb5f40b59ec881c1d988fbe/src/main/java/com/appland/appmap/record/Recorder.java#L220 to wrap the code you want to record.
1
u/MR_GABARISE May 13 '21
Looks like it!
Recorder also looks like a great place one could register event listeners, if there were any way to do it, since that seems to be the pattern at play here. It would open up a great API for anyone willing to develop third party functionality.
4
u/kgilpin72 May 13 '21
Cool. Well it’s open source so if you can think of ways to adapt it to what you need, we are all ears.
1
u/kgilpin72 May 13 '21 edited May 13 '21
Hi all, a while back we posted this announcement - Visualize the architecture of your Java app, in VS Code, and the top comments were - "Can we get this for IntelliJ"? So, we are excited to announce that yes, this same open source AppMap capability now works with IntelliJ.
If you would prefer to see the content of this video in written form, you can find a transcript at https://dev.to/appland/visualize-the-architecture-of-your-java-app-in-intellij-idea-in-2-minutes-2dp7.
Direct link: IntelliJ quick start instructions
Thanks for watching!
1
May 14 '21 edited Jul 05 '25
rich nine imminent existence offer groovy ink silky crown chunky
This post was mass deleted and anonymized with Redact
1
u/kgilpin72 May 14 '21
Hi, if you’re interested in making a recording of your app while you use it, check out my other comment - https://www.reddit.com/r/java/comments/nbgj7l/visualize_the_architecture_of_your_java_app_in/gxzwaze/?
This will give you a bigger scope than a test.
1
u/kevintweber May 13 '21
How does this compare to other tracing programs like Zipkin and Jaeger?
3
u/kgilpin72 May 13 '21
Zipkin and Jaeger are for distributed tracing, which to me suggests that you would instrument your apps and then run them in a test, staging (or production?) environment to get the data. AppMap is primarily used in your development environment, as you code. It also looks like Zipkin and Jaeger tracing is network-based, so it shows you HTTP and SQL, which AppMap also does. AppMap also shows code internals such as actual classes and functions which are performing key operations like authentication, caching, or whatever else you want to track in your codebase. And you can see function parameters, return values, and exceptions. AppMap has tighter integration with the code frameworks themselves, like Spring and java.sql, to give you more insight into what's going on inside your code and in the framework code.
Distributed tracing tools are going to give you information and feedback on your code at deployment time, which is definitely valuable. AppMap is primarily going to be used upstream of that, while you are coding, and when you're in code review. You'll get code design feedback earlier, and it will be more code-oriented rather than deployment-oriented.
Hope that helps.
3
1
u/nezda May 13 '21
I’m having a hard time figuring out if this costs money 💰!?
3
u/kgilpin72 May 13 '21
No it’s free and open source. In the future there may be add-on services that you can subscribe to, but everything presented here is FOSS forever.
5
u/cronofdoom May 13 '21
Wow I’m going to have to try this out. I’ve tried a few tools and never really been satisfied with what I have found.
are there any other really good visual plug-ins people in here used to map out Java system architecture that actually look really good?
4
u/agentoutlier May 13 '21
I have seen lots of Java Flame Graph like tools but I haven't seen them advertised as architecture exploration tools but they can be use in similar manner (e.g. you can google flame graph).
The architecture exploration tools I have also seen do static analysis and generate shitty UML or something akin.
Anyway trivial googling found this one: http://findtheflow.io/
I have no idea if its good but it looks like the flame graph model.
1
u/vqrs May 20 '21
I've used fimdtheflow on the past on our legacy application and it's been really useful but I think it's abandonware unfortunately.
1
u/Henry1502inc May 15 '21
So when I searched AppMap from within IDEA (plugin > marketplace), nothing pops up. I had to Google AppMap intellij and even then it brought me to a webpage where I had to download and replace files which I don't want to do since idk what I'm doing
1
u/guyOnReddit3000 May 15 '21
I tried to find it as well but I believe it is only available for the premium version of IntelliJ. :(
1
u/Henry1502inc May 15 '21
I have the premium version of IntelliJ though. I don’t have the commercial rights. I think community is the free version.
2
u/kgilpin72 May 16 '21
It may not be showing up in the search because you don’t have a recent enough version of IntelliJ. It requires a recent version in order to use the new WebView plugins feature. So try checking your installed version against the version requirements on the plug-in info page?
3
3
2
2
2
u/maxandersen May 13 '21
Have the ability to activate tracing via property been added back yet ?
See this precious thread
5
u/dustinbyrne May 13 '21 edited May 13 '21
It's actually been pending release. I'll push it through now and update this post when it's live :)
EDIT:
com.appland.appmap-agentversion1.1.0is now live on Maven Central. The official release is also available on GitHub: https://github.com/applandinc/appmap-java/releases/tag/v1.1.0There are three new properties added to control automatic recording (
appmap.recording.*). See the documentation here: https://github.com/applandinc/appmap-java#system-properties2
u/maxandersen May 14 '21
cool - does it have to be system properties or can I specify it via the yaml too?
3
u/maxandersen May 14 '21
it works :)
```
jbang --javaagent=https://github.com/applandinc/appmap-java/releases/download/v1.1.0/appmap-1.1.0.jar -Dappmap.recording.auto=true
myapp.jar
```
found bug when having empty app.yml: https://github.com/applandinc/appmap-java/issues/80 but if filled out it works.
1
1
u/dustinbyrne May 15 '21
Currently we only support system properties. In the case of
jbang, I can see how providing this configuration through theappmap.ymlfile would be ideal, as it would cut down on the length of the command line.I'll raise this issue to the team and see what kind of solution we can come up with.
1
u/maxandersen May 15 '21
Well, if you could do only system properties then I could put these into a .Java file and not need the yaml unless absolutely needed :)
-7
u/1bot4all May 13 '21
There should be a link somewhere in this thread? Am I supposed to type the url in the address bar? Gross...
6
u/kgilpin72 May 13 '21
If you mean the setup instructions for IntelliJ - https://appland.com/docs/quickstart/intellij/step-1
Otherwise, let me know which link you are looking for.
2
u/AreTheseMyFeet May 13 '21
The other poster was more than a little entitled in their wording but its often the case that since reddit doesn't allow link & text submissions (just one or the other) that if you want to use the link option for a promotional video you might also leave a top-level reply with a short project/subject intro and any relevant links.
Also, not everyone can, wants or prefers to watch a video so a textual fallback can get you more eyes and interest as well. ;)
2
u/kgilpin72 May 13 '21
OK, thanks that makes sense.
When I made this post, I did add a comment - https://www.reddit.com/r/java/comments/nbgj7l/visualize_the_architecture_of_your_java_app_in/gxz4euh?utm_source=share&utm_medium=web2x&context=3 - which includes a link to a text transcript. But it didn't get any upvotes so it's pretty well buried down the thread list and maybe that's why people aren't finding it.
19
u/immortalgeek May 13 '21
This is really cool and I will definitely check it out.
Tough one question I have after watching the video is, how does it record db/SQL details when you run your unit tests? Ideally all of that should be mocked. Or is that part of the video talking about integration tests?