Skip to content

Utilities for building useful directed graphs images from Java code, Java artifacts, or call stacks of running threads.

License

Notifications You must be signed in to change notification settings

ricklindstrom/directed-graph-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Directed Graph Builder

Utilities for building useful directed graphs images from Java code, Java artifacts, or call stacks of running threads.

This project contains utilities for

BUILDING

  • Directed graphs - Primarily graphviz files (but also Gephi (gefx) or TGF files)

FROM

  • Java code,
  • Java artifacts like runtime Spring configuration,
  • Call Stacks of Running Threads,
  • (Maybe other sources soon.)

WHY

Because the ability to quickly navigate and understand a large software system is essential.

Sample Output Fragment

(Shrunken to protect the guilty.)

http://directedgraphbuilder.googlecode.com/svn/trunk/spring-context-example.png

(This link to this image likes to break. But trust me, the generated diagram for a project with a dozen spring context files hundreds of configured beans looks pretty good and is really useful for understanding the architecture of a system.)

Sample Usage

Can be used to aid generating Graphviz files (that are reasonably-well laid out and colored) from within Java code:

(new Graph()).addEdge("hello", "world").save("helloworld.dot");

See HowToUseGraphJava for more detail usage and examples.

Can be used to generate Graphviz files from runtime spring configuration:

<bean id="graphvizPostProcessor" class="com.directedgraphbuilder.GraphvizPostProcessor"/>

Each node and edge is clustered and colored based on what spring configuration file defines it.

Can be used to generate Graphviz files from executing threads.

    CallGraphBuilder b = new CallGraphBuilder();
    b.add(Thread.currentThread().getStackTrace());     
    Graph g = b.buildGraph();

Alternatively, CallGraphBuilder can also manage the Graph (in a ThreadLocal variable)

    CallGraphBuilder.start();
    CallGraphBuilder.capture();
    Graph g = CallGraphBuilder.stop();
    g.save();

==To Build==

    mvn clean install

About

Utilities for building useful directed graphs images from Java code, Java artifacts, or call stacks of running threads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published