Skip to content

Commit

Permalink
upstream merge from 'develop' into 'features/#87/swingworker'
Browse files Browse the repository at this point in the history
  • Loading branch information
chewiebug committed Feb 25, 2015
2 parents 2076b9e + 60f537b commit c0dd10b
Show file tree
Hide file tree
Showing 36 changed files with 1,169 additions and 1,024 deletions.
12 changes: 8 additions & 4 deletions README
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
GCViewer 1.34.1
===============
GCViewer 1.35
=============

GCViewer is a little tool that visualizes verbose GC output
generated by Sun / Oracle, IBM, HP and BEA Java Virtual Machines. It
is free software released under GNU LGPL.

You can start GCViewer (gui) by simply double-clicking on gcviewer-1.3x.jar
or running java -jar gcviewer-1.3x.jar (it needs a java 1.7 vm to run).
or running java -jar gcviewer-1.3x.jar (it needs a java 1.8 vm to run).

For a cmdline based report summary just type:
java -jar gcviewer-1.3x.jar gc.log summary.csv [chart.png] [-t PLAIN|CSV|CSV_TS|SIMPLE|SUMMARY]
Expand All @@ -26,7 +26,11 @@ Supported verbose:gc formats are:
- HP-UX JDK 1.2/1.3/1.4.x with the option -Xverbosegc
- BEA JRockit 1.4.2/1.5/1.6 with the option -verbose:memory [-Xverbose:gcpause,gcreport] [-Xverbosetimestamp]

Best results are achieved with: -Xloggc:<file> -XX:+PrintGCDetails -XX:+PrintGCDateStamps
Best results are achieved with: -Xloggc:<file> -XX:+PrintGCDetails -XX:+PrintGCDateStamps.
A few other options are supported, but most of the information generated is ignored by GCViewer
(the javadoc introduction of
https://github.com/chewiebug/GCViewer/blob/master/src/main/java/com/tagtraum/perf/gcviewer/imp/DataReaderSun1_6_0.java
shows the details).

Hendrik Schreiber wrote GCViewer up to 1.29. What you are seeing here is based
on his very good work.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import java.util.Iterator;

/**
* Write GC history with comma separated values.
* <p>
* It uses the {@literal "Timestamp(sec/#),Used(K),Total(K),Pause(sec),GC-Type"} format.
*
* Date: Feb 1, 2002
* Time: 10:07:52 AM
* @author <a href="mailto:[email protected]">Hendrik Schreiber</a>
*/
public class CSVDataWriter extends AbstractDataWriter {
Expand Down Expand Up @@ -64,7 +65,7 @@ public void write(GCModel model) throws IOException {
out.println("NONE");
}
}

out.flush();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import java.util.Iterator;

/**
* Export GC history with comma separated values.
* <p>
* It uses the {@literal "Timestamp(unix/#),Used(K),Total(K),Pause(sec),GC-Type"} format.
*
* Date: Feb 1, 2002
* Time: 10:07:52 AM
* @author <a href="mailto:[email protected]">Hendrik Schreiber</a>
*/
public class CSVTSDataWriter extends AbstractDataWriter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
/**
*
*
*/
package com.tagtraum.perf.gcviewer.exp.impl;

/**
* Write Summary Information in CSV format.
* <p>
* Write each summary metric on its own line with {@literal "tag; value; unit"} format.
*
* @author sean
*
*/
public class CsvSummaryExportFormatter implements ISummaryExportFormatter {

private String separator = "; ";
/**
* @see ISummaryExportFormatter#formatLine(String, String, String)
*/
@Override
public String formatLine(String tag, String value, String units) {
private String separator = "; ";

/**
* @see ISummaryExportFormatter#formatLine(String, String, String)
*/
@Override
public String formatLine(String tag, String value, String units) {
return tag + separator + value + separator + units;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
import com.tagtraum.perf.gcviewer.model.GCModel;

/**
* <p>Exports stop-the-world events in the "simple gc log" format (compatible to GCHisto).</p>
* <p>This writer writes every event on its own line with the following format<br/>
* GC_TYPE START_SEC DURATION_SEC</p>
*
* Exports stop-the-world events in the "simple gc log" format (compatible to GCHisto).
* <p>
* This writer writes every event on its own line with the following format
* <p>
* {@code GC_TYPE START_SEC DURATION_SEC}
*
* @see <a href="http://mail.openjdk.java.net/pipermail/hotspot-gc-use/2012-November/001428.html">http://mail.openjdk.java.net/pipermail/hotspot-gc-use/2012-November/001428.html</a>
* @see <a href="http://java.net/projects/gchisto">GCHisto</a>
* @see <a href="https://svn.java.net/svn/gchisto~svn/trunk/www/index.html">GCHisto documentation</a>
*
*
* @author <a href="mailto:[email protected]">Joerg Wuethrich</a>
* <p>created on: 08.12.2012</p>
*/
public class SimpleGcWriter extends AbstractDataWriter {

Expand All @@ -38,26 +39,26 @@ public void write(GCModel model) throws IOException {
while (i.hasNext()) {
AbstractGCEvent<?> abstractEvent = i.next();
if (abstractEvent.isStopTheWorld()) {
out.printf(NO_LOCALE,
"%s %f %f%n",
getSimpleType(abstractEvent),
abstractEvent.getTimestamp(),
out.printf(NO_LOCALE,
"%s %f %f%n",
getSimpleType(abstractEvent),
abstractEvent.getTimestamp(),
abstractEvent.getPause());
}
}

out.flush();
}

/**
* Simple GC Logs GC_TYPE must not contain spaces. This method makes sure they don't.
*
*
* @param typeName name of the gc event type
* @return name without spaces
*/
private String getSimpleType(AbstractGCEvent<?> event) {
String simpleType;

if (isYoungOnly(event)) {
simpleType = "YoungGC";
}
Expand All @@ -73,13 +74,13 @@ else if (event.isFull()) {
else {
simpleType = stripBlanks(event.getTypeAsString());
}

return simpleType;
}

/**
* Does the event consist of young generation events only (main and detail events).
*
*
* @param event event to be analysed.
* @return <code>true</code> if the event is only in the young generation, <code>false</code> otherwise
*/
Expand All @@ -100,18 +101,18 @@ else if (event.getExtendedType().getGeneration().equals(Generation.YOUNG)) {
}
}
}

return isYoungOnly;
}

private String stripBlanks(String eventTypeName) {
StringBuilder sb = new StringBuilder(eventTypeName);
for (int i = sb.length()-1; i >= 0; --i) {
if (sb.charAt(i) == ' ') {
sb.deleteCharAt(i);
}
}

return sb.toString();
}

Expand Down
Loading

0 comments on commit c0dd10b

Please sign in to comment.