@Override public void shutdown() { //new Exception("SHUTDOWN MonitorConsoleStage ").printStackTrace(); //Send in pipe depth data boolean writeImage = false; if (writeImage) { GraphManager.exportGraphDotFile(graphManager, "MonitorResults", true, percentileFullValues, trafficValues, messagesPerSecondValues); } }
public void exportGraphDotFile() { exportGraphDotFile(this, "graph.dot", true); }
public static void exportGraphDotFile(GraphManager gm, String filename, boolean isVertical, int[] percentileValues, long[] traffic, int[] msgPerSec) { // new Exception("GENERATING NEW DOT FILE "+filename).printStackTrace(); FileOutputStream fost; try { AppendableBuilder target = new AppendableBuilder(1<<24); gm.writeAsDOT(gm, filename, target, isVertical, percentileValues, traffic, msgPerSec); fost = new FileOutputStream(filename); target.copyTo(fost); fost.close(); //to produce the png we must call // dot -Tpng -O deviceGraph.dot Process result = Runtime.getRuntime().exec("dot -Tsvg -o"+filename+".svg "+filename); if (0!=result.waitFor()) { return; } } catch (Throwable e) { logger.trace("No runtime graph produced. ",e); } }
GraphManager.exportGraphDotFile(gm, "UnitTest", true); PipeMonitorCollectorStage.attach(gm);