-
Notifications
You must be signed in to change notification settings - Fork 982
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upstream merge from 'develop' into 'features/#87/swingworker'
- Loading branch information
Showing
36 changed files
with
1,169 additions
and
1,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -64,7 +65,7 @@ public void write(GCModel model) throws IOException { | |
out.println("NONE"); | ||
} | ||
} | ||
|
||
out.flush(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
22 changes: 13 additions & 9 deletions
22
src/main/java/com/tagtraum/perf/gcviewer/exp/impl/CsvSummaryExportFormatter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
||
|
@@ -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"; | ||
} | ||
|
@@ -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 | ||
*/ | ||
|
@@ -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(); | ||
} | ||
|
||
|
Oops, something went wrong.