Skip to content

Instantly share code, notes, and snippets.

@igor-suhorukov
Created February 21, 2018 20:13
Show Gist options
  • Save igor-suhorukov/ddd5c9cac11615d93d0c6c19f65b42b8 to your computer and use it in GitHub Desktop.
Save igor-suhorukov/ddd5c9cac11615d93d0c6c19f65b42b8 to your computer and use it in GitHub Desktop.
public static void main(String[] args) throws Exception{
CliClient cliClient = new CliClient();
Map<String, MethodCall> connect = cliClient.connect(UUID.randomUUID().toString(), "127.0.0.1", 60001, "org.springframework.boot.*");
Set<Map.Entry<String, MethodCall>> entries = connect.entrySet();
for(Map.Entry<String, MethodCall> entry : entries){
if(entry.getKey().endsWith("<init>") ||
entry.getKey().endsWith("<clinit>")) continue;
String diagram = SdEditDataRenderer.getSequenceDiagram(entry.getValue());
if(diagram.split("\n").length>100){
System.out.println("diagram too large "+entry.getKey());
continue;
}
byte[] image = createImage(diagram);
FileOutputStream outputStream = new FileOutputStream(entry.getKey().replace("#","_")+".png");
IOUtils.copyAndClose(new ByteArrayInputStream(image), outputStream);
}
System.out.println();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment