Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bschoening committed Nov 16, 2021
1 parent 88bfcdf commit 2f1f2e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gc_log_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import sys
import re
import tempfile
import os
import dateutil.parser


class StwSubTimings:
def __init__(self):
self.reset()
Expand All @@ -24,6 +24,7 @@ def unknown_time(self, total):
else:
return 0


class LogParser:
heapG1GCPattern = '\s*\[Eden: ([0-9.]+)([BKMG])\(([0-9.]+)([BKMG])\)->[0-9.BKMG()]+ Survivors: ([0-9.]+)([BKMG])->([0-9.]+)([BKMG]) Heap: ([0-9.]+)([BKMG])\([0-9.BKMG]+\)->([0-9.]+)([BKMG])\([0-9.BKMG]+\)'
parallelPattern = '\s*\[PSYoungGen: ([0-9.]+)([BKMG])->([0-9.]+)([BKMG])\([0-9.MKBG]+\)\] ([0-9.]+)([MKBG])->([0-9.]+)([MKBG])\([0-9.MKBG]+\),'
Expand Down Expand Up @@ -71,7 +72,7 @@ def __init__(self, input_file):
self.full_gc = False
self.gc = False
self.root_scan_start_time = 0
self.root_scan_end_timestamp = 0
self.root_scan_end_timestamp = None
self.root_scan_mark_end_time = 0
self.mixed_duration_start_time = 0
self.mixed_duration_count = 0
Expand Down Expand Up @@ -348,7 +349,7 @@ def parse_log(self):

def output_data(self):
if self.mixed_duration_count == 0:
self.young_pause_file.write("%s %.6f\n" % (self.timestamp_string(), self.pause_time))
self.young_pause_file.write(f"{self.timestamp_string()} {self.pause_time}.6f\n")
else:
self.mixed_pause_file.write("%s %.6f\n" % (self.timestamp_string(), self.pause_time))

Expand Down

0 comments on commit 2f1f2e3

Please sign in to comment.