Skip to content

Commit fd9b977

Browse files
Gracefully failing to the non-unix time if datestamp not available
1 parent d3db8ad commit fd9b977

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ public void write(GCModel model) throws IOException {
3636
// Since this data writer is only concerned with one line per gc entry, don't write two like the others.
3737

3838
// If the true timestamp is present, output the unix timestamp
39-
if (model.hasCorrectTimestamp()) {
39+
if (model.hasDateStamp()) {
4040
out.print(event.getDatestamp().getTime());
41+
} else if (model.hasCorrectTimestamp()) {
42+
// we have the timestamps therefore we can correct it with the pause time
43+
out.print((event.getTimestamp() - event.getPause()));
4144
} else {
4245
out.print(event.getTimestamp());
4346
}

0 commit comments

Comments
 (0)