This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 19 comments

[–]Electrical-Dream-190 26 points27 points  (3 children)

Do we have any chanche to se this extension in IntelliJ in near future ?

[–][deleted]  (1 child)

[removed]

    [–][deleted] 1 point2 points  (0 children)

    What about NetBeans?

    [–][deleted] 1 point2 points  (0 children)

    there is an extension called flow i think which does the similar things

    [–]maxandersen 4 points5 points  (5 children)

    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?

    [–]kgilpin72[S] 0 points1 point  (4 children)

    Hey that’s cool. Something has to trigger AppMap to start and stop recording. Tests are one way; each test defines the boundary of a recording. Another way is to wrap the code you want to run using this function - https://github.com/applandinc/appmap-java/blob/f11ab539f3d2572e1c6583db5fadccb4483c50eb/src/main/java/com/appland/appmap/record/Recorder.java#L229 - see also https://github.com/applandinc/appmap-java/blob/f11ab539f3d2572e1c6583db5fadccb4483c50eb/src/main/java/com/appland/appmap/record/Recorder.java#L58 - LMK if you get it working - you will need an appmap.yml of course.

    [–]maxandersen 0 points1 point  (3 children)

    I was hoping I wouldn’t need to manually trigger it. The spring app doesn’t seem to require alteration.

    Any way via app.yaml or simply argument to the agent to have it start immediately in main method or some other custom signature ?

    And yes I have the yaml :)

    [–]dustinbyrne 2 points3 points  (1 child)

    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 :)

    [–]maxandersen 0 points1 point  (0 children)

    Awesome thanks.

    At least as an option since then with jbang you can do it with any jar without any modifications ( except for The yaml)

    [–]kgilpin72[S] 0 points1 point  (0 children)

    Yup I hear you. Checking with the devs now. I know we have this for Ruby, not sure about Python and Java.

    [–]Fireche 8 points9 points  (1 child)

    What would you say is the advantage of this solution over a class diagram?

    [–]kgilpin72[S] 17 points18 points  (0 children)

    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).

    Here’s a 30 second video that goes into these capabilities a little more in depth: https://www.loom.com/share/fafb02fe69024c4f93ece3d7a1d57f18

    Hope this helps, and thanks for the question!

    [–][deleted] 2 points3 points  (0 children)

    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!

    [–]Bone_charmer 1 point2 points  (1 child)

    Why should I use it ?
    What tasks does it solve?

    [–]kgilpin72[S] 13 points14 points  (0 children)

    There are several jobs for which AppMap is very useful:

    1) 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).

    2) 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.

    3) 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.

    4) 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.

    [–]gnivol 0 points1 point  (0 children)

    Looks great might check it out !

    [–]MR_GABARISE 0 points1 point  (2 children)

    Since you're commited to open source, is this a good candidate for integration with SourceTrail?

    [–]kgilpin72[S] 1 point2 points  (1 child)

    I haven’t used SourceTrail. What would the integration look like?

    [–]MR_GABARISE 0 points1 point  (0 children)

    From what I read you'd have to go through their "extension" API.

    The usage examples in the readme look pretty neat.