@Test public void testDump() throws Throwable { Profiler profiler = new Profiler(); profiler.dump(new PrintStream(new ByteArrayOutputStream()), "testProfilerIndent"); assertEquals(1, profiler.events.size(), "profiler.events.size()"); }
public void dump (PrintStream p, String indent) { String inner = indent + " "; if (!events.containsKey("end")) checkPoint ("end"); Collection c = events.values(); Iterator iter = c.iterator(); p.println (indent + "<profiler>"); while (iter.hasNext()) p.println (inner + ISOUtil.normalize(iter.next().toString())); p.println (indent + "</profiler>"); }
Profiler implements Loggeable { public void dump (PrintStream p, String indent) { String inner = indent + " "; if (!events.containsKey("end")) checkPoint ("end"); Collection c = events.values(); Iterator iter = c.iterator(); p.println (indent + "<profiler>"); while (iter.hasNext()) p.println (inner + ISOUtil.normalize(iter.next().toString())); p.println (indent + "</profiler>"); } }
Profiler implements Loggeable { public void dump (PrintStream p, String indent) { String inner = indent + " "; if (!events.containsKey("end")) checkPoint ("end"); Collection c = events.values(); Iterator iter = c.iterator(); p.println (indent + "<profiler>"); while (iter.hasNext()) p.println (inner + ISOUtil.normalize(iter.next().toString())); p.println (indent + "</profiler>"); } Profiler(); }
Profiler implements Loggeable { public void dump (PrintStream p, String indent) { String inner = indent + " "; if (!events.containsKey("end")) checkPoint ("end"); Collection c = events.values(); Iterator iter = c.iterator(); p.println (indent + "<profiler>"); while (iter.hasNext()) p.println (inner + ISOUtil.normalize(iter.next().toString())); p.println (indent + "</profiler>"); } Profiler(); void reset(); @SuppressWarnings("unchecked") synchronized void checkPoint(String detail); long getElapsed(); long getElapsedInMillis(); long getPartial(); long getPartialInMillis(); void dump(PrintStream p, String indent); LinkedHashMap<String, Entry> getEvents(); Entry getEntry(String eventName); void reenable(); }
Profiler implements Loggeable { public void dump (PrintStream p, String indent) { String inner = indent + " "; if (!events.containsKey("end")) checkPoint ("end"); Collection c = events.values(); Iterator iter = c.iterator(); p.println (indent + "<profiler>"); while (iter.hasNext()) p.println (inner + ISOUtil.normalize(iter.next().toString())); p.println (indent + "</profiler>"); } Profiler(); void reset(); @SuppressWarnings("unchecked") synchronized void checkPoint(String detail); long getElapsed(); long getElapsedInMillis(); long getPartial(); long getPartialInMillis(); void dump(PrintStream p, String indent); LinkedHashMap<String, Entry> getEvents(); Entry getEntry(String eventName); void reenable(); static final int TO_MILLIS; }