[jboss-cvs] JBoss Profiler SVN: r484 - branches/JBossProfiler2/src/main/org/jboss/profiler/client.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 22 15:49:59 EDT 2008
Author: jesper.pedersen
Date: 2008-10-22 15:49:58 -0400 (Wed, 22 Oct 2008)
New Revision: 484
Modified:
branches/JBossProfiler2/src/main/org/jboss/profiler/client/SnapshotUtil.java
Log:
Improve reports
Modified: branches/JBossProfiler2/src/main/org/jboss/profiler/client/SnapshotUtil.java
===================================================================
--- branches/JBossProfiler2/src/main/org/jboss/profiler/client/SnapshotUtil.java 2008-10-20 20:58:24 UTC (rev 483)
+++ branches/JBossProfiler2/src/main/org/jboss/profiler/client/SnapshotUtil.java 2008-10-22 19:49:58 UTC (rev 484)
@@ -42,6 +42,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
+import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.List;
@@ -227,9 +228,11 @@
FileWriter fw = new FileWriter(directory + "overview.txt");
BufferedWriter bw = new BufferedWriter(fw, 8192);
- bw.write("From: " + dateFormat.format(snapshot.getFrom()) + NEW_LINE);
- bw.write("To : " + dateFormat.format(snapshot.getTo()) + NEW_LINE);
+ bw.write("From : " + dateFormat.format(snapshot.getFrom()) + NEW_LINE);
+ bw.write("To : " + dateFormat.format(snapshot.getTo()) + NEW_LINE);
bw.write(NEW_LINE);
+ bw.write("Total: " + df.format(new Date(snapshot.getTo().getTime() - snapshot.getFrom().getTime()).getTime()) + " ms" + NEW_LINE);
+ bw.write(NEW_LINE);
Collections.sort(snapshot.getThreads(), new ThreadComparator());
@@ -374,7 +377,7 @@
protected void dumpMostTime(Map<String, List<CombinedFrameInfo>> info, Writer w) throws Exception {
w.write("Most time:" + NEW_LINE);
w.write("==========" + NEW_LINE);
- w.write("Count\tMs\t%\tMethod" + NEW_LINE);
+ w.write("Count\tMs\tAvg\t%\tMethod" + NEW_LINE);
List<CombinedFrameInfo> allMethods = new ArrayList<CombinedFrameInfo>();
@@ -393,6 +396,7 @@
w.write(cfi.getCount() + "\t");
w.write(df.format(cfi.getTotalTime()) + "\t");
+ w.write(df.format(cfi.getTotalTime() / cfi.getCount()) + "\t");
w.write(df.format(cfi.getPercent()) + "\t");
w.write(cfi.getPrettyName() + NEW_LINE);
}
@@ -808,22 +812,11 @@
bw.write("Count\tMs\tMethod");
bw.write(NEW_LINE);
- int count = 0;
-
for (CombinedFrameInfo cfi : callers) {
- if (cfi.getTotalTime() > threshold) {
- bw.write(cfi.getCount() + "\t");
- bw.write(df.format(cfi.getTotalTime()) + "\t");
- bw.write(cfi.getPrettyName());
- bw.write(NEW_LINE);
- } else {
- count++;
- }
- }
-
- if (count > 0) {
+ bw.write(cfi.getCount() + "\t");
+ bw.write(df.format(cfi.getTotalTime()) + "\t");
+ bw.write(cfi.getPrettyName());
bw.write(NEW_LINE);
- bw.write(count + " methods below threshold." + NEW_LINE);
}
bw.write(NEW_LINE);
More information about the jboss-cvs-commits
mailing list