Thursday, December 5

Program HN: FlowTracker– Track information streaming through Java programs

FlowTracker

Track information streaming through Java programs, get brand-new understanding at a look.

FlowTracker is a Java representative that tracks how a program checks out, controls, and composes information. By enjoying a program run, it can reveal what file and network I/O occurred, however more notably linking its inputs and outputs to reveal where its output originated from. This assists you comprehend what any Java program’s output methods and why it composed it.

This proof-of-concept explores what insights we manage taking a look at program behaviour from this point of view.

Demonstration

Spring PetClinic is a demonstration application for the Spring structure. To show FlowTracker’s capabilities, we let it observe PetClinic dealing with an HTTP demand and producing an HTML page based upon a design template and information from a database. You can utilize this demonstration in your web browser, without setting up anything. Open the FlowTracker PetClinic demonstration, or enjoy the video listed below.

petclinic.mp4

You see the HTTP action that FlowTracker saw PetClinic send out over the network. Click a part of the contents of the HTTP reaction to see in the bottom view where that part originated from. You can choose another tracked origin/input or sink/output in the tree left wing (or bottom left button on mobile).

Exploring this HTTP reaction, we browse through numerous layers of the software application stack:

  • HTTP handling FlowTracker reveals what code produced what outputClick “HTTP/1.1” or the HTTP headers. You see that this part of the reaction was produced by apache coyote (classes in the org.apache.coyote bundle), pointing you to where precisely each header originated from.
  • Thymeleaf design templates FlowTracker demonstrates how the input the program checks out (the HTML design templates) represents the outputClick an HTML tag name, like “html” or “head”. You see the layout.html file, where this part of the HTML page originates from. If you click layout.html, and after that on the vibrant + button at the bottom, then whatever originating from that file will be marked in the very same color. Scrolling down you’ll then see part of the reaction originates from a various file, ownerDetails.html. Click a < < or > > to see that those characters were composed by the Thymeleaf templating library.
  • Database The HTML page consists of a table with details that originates from the database. Clicking George because table does not just reveal that worth originated from the database. It goes even more: it traced all of it the method back to the SQL script that placed that worth in the database in top place.

Because demonstration, the tracking as much as the SQL script works since it was utilizing an in-memory database. The database material never ever left the JVM, so FlowTracker might completely monitor it. When we run the very same demonstration however with a mysql database, then we track those worths as much as the database connection: we see the SQL inquiry sent out previously to produce them,

ยป …
Learn more