Skip to content

Commit b363505

Browse files
committed
#199 add number of pauses + more memory information
1 parent f75537e commit b363505

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

src/main/java/com/tagtraum/perf/gcviewer/exp/impl/SummaryDataWriter.java

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ public void exportSummaryFromModel(GCModel model, String filePath) throws IOExce
135135
}
136136

137137
private void exportOverallSummary(PrintWriter out, GCModel model) {
138-
exportValue(out, "accumPause", gcTimeFormatter.format(model.getPause().getSum()), "s");
139-
140138
FormattedValue formed = footprintFormatter.formatToFormatted(model.getFootprint());
141139
exportValue(out, "footprint", formed.getValue(), formed.getUnits());
142140

@@ -183,6 +181,8 @@ private void exportPauseSummary(PrintWriter out, GCModel model) {
183181
final boolean fullGCDataAvailable = model.getFullGCPause().getN() > 0;
184182

185183
if (pauseDataAvailable) {
184+
exportValue(out, "pauseCount", "" + model.getPause().getN(), "-");
185+
186186
exportValue(out, "avgPauseIsSig", isSignificant(model.getPause().average(), model.getPause().standardDeviation()) );
187187
exportValue(out, "avgPause", pauseFormatter.format(model.getPause().average()), "s");
188188
exportValue(out, "avgPause\u03c3", pauseFormatter.format(model.getPause().standardDeviation()), "s");
@@ -191,6 +191,8 @@ private void exportPauseSummary(PrintWriter out, GCModel model) {
191191
exportValue(out, "maxPause", pauseFormatter.format(model.getPause().getMax()), "s");
192192

193193
if (gcDataAvailable) {
194+
exportValue(out, "gcPauseCount", "" + model.getGCPause().getN(), "-");
195+
194196
exportValue(out, "avgGCPauseIsSig", isSignificant(model.getGCPause().average(), model.getGCPause().standardDeviation()) );
195197
exportValue(out, "avgGCPause", pauseFormatter.format(model.getGCPause().average()), "s");
196198
exportValue(out, "avgGCPause\u03c3", pauseFormatter.format(model.getGCPause().standardDeviation()), "s");
@@ -200,9 +202,12 @@ private void exportPauseSummary(PrintWriter out, GCModel model) {
200202
}
201203

202204
if (fullGCDataAvailable) {
205+
exportValue(out, "fullGcPauseCount", "" + model.getFullGCPause().getN(), "-");
206+
203207
exportValue(out, "avgFullGCPauseIsSig", isSignificant(model.getFullGCPause().average(), model.getFullGCPause().standardDeviation()));
204208
exportValue(out, "avgFullGCPause", pauseFormatter.format(model.getFullGCPause().average()), "s");
205209
exportValue(out, "avgFullGCPause\u03c3", pauseFormatter.format(model.getFullGCPause().standardDeviation()), "s");
210+
206211
exportValue(out, "minFullGCPause", pauseFormatter.format(model.getFullGCPause().getMin()), "s");
207212
exportValue(out, "maxFullGCPause", pauseFormatter.format(model.getFullGCPause().getMax()), "s");
208213
}
@@ -231,8 +236,35 @@ private boolean isSignificant(final double average, final double standardDeviati
231236
}
232237

233238
private void exportMemorySummary(PrintWriter out, GCModel model) {
234-
FormattedValue formed = footprintFormatter.formatToFormatted(model.getFootprint());
235-
exportValue(out, "footprint", formed.getValue(), formed.getUnits());
239+
FormattedValue formed = footprintFormatter.formatToFormatted(model.getHeapAllocatedSizes().getMax());
240+
exportValue(out, "totalHeapAllocMax", formed.getValue(), formed.getUnits());
241+
formed = footprintFormatter.formatToFormatted(model.getHeapUsedSizes().getMax());
242+
exportValue(out, "totalHeapUsedMax", formed.getValue(), formed.getUnits());
243+
exportValue(out, "totalHeapUsedMaxpc", percentFormatter.format(model.getHeapUsedSizes().getMax() * 100.0 / model.getHeapAllocatedSizes().getMax()), "%");
244+
245+
if (model.getTenuredAllocatedSizes().getN() == 0) {
246+
exportValue(out, "totalTenuredAllocMax", "n/a", "M");
247+
exportValue(out, "totalTenuredUsedMax", "n/a", "M");
248+
exportValue(out, "totalTenuredUsedMaxpc", "n/a", "%");
249+
} else {
250+
formed = footprintFormatter.formatToFormatted(model.getTenuredAllocatedSizes().getMax());
251+
exportValue(out, "totalTenuredAllocMax", formed.getValue(), formed.getUnits());
252+
formed = footprintFormatter.formatToFormatted(model.getTenuredUsedSizes().getMax());
253+
exportValue(out, "totalTenuredUsedMax", formed.getValue(), formed.getUnits());
254+
exportValue(out, "totalTenuredUsedMaxpc", percentFormatter.format(model.getTenuredUsedSizes().getMax() * 100.0 / model.getTenuredAllocatedSizes().getMax()), "%");
255+
}
256+
257+
if (model.getYoungAllocatedSizes().getN() == 0) {
258+
exportValue(out, "totalYoungAllocMax", "n/a", "M");
259+
exportValue(out, "totalYoungUsedMax", "n/a", "M");
260+
exportValue(out, "totalYoungUsedMaxpc", "n/a", "%");
261+
} else {
262+
formed = footprintFormatter.formatToFormatted(model.getYoungAllocatedSizes().getMax());
263+
exportValue(out, "totalYoungAllocMax", formed.getValue(), formed.getUnits());
264+
formed = footprintFormatter.formatToFormatted(model.getYoungUsedSizes().getMax());
265+
exportValue(out, "totalYoungUsedMax", formed.getValue(), formed.getUnits());
266+
exportValue(out, "totalYoungUsedMaxpc", percentFormatter.format(model.getYoungUsedSizes().getMax() * 100.0 / model.getYoungAllocatedSizes().getMax()), "%");
267+
}
236268

237269
// check whether we have full gc data at all
238270
final boolean fullGCDataVailable = model.getFootprintAfterFullGC().getN() != 0;
@@ -317,8 +349,6 @@ private void exportMemorySummary(PrintWriter out, GCModel model) {
317349
exportValue(out, "avgFreedMemoryByGCisSig", isSignificant(model.getFreedMemoryByGC().average(),
318350
model.getFreedMemoryByGC().standardDeviation()));
319351
}
320-
formed = footprintFormatter.formatToFormatted(model.getFreedMemory());
321-
exportValue(out, "freedMemory", formed.getValue(), formed.getUnits());
322352
}
323353

324354
private FormattedValue sigmaMemoryFormat(double value) {

0 commit comments

Comments
 (0)