Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 32 additions & 27 deletions gc_log_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ def gnuplot(self, name, start, end):
return

def determine_gc_alg(self):
with open(self.input_file) as f:
filename = self.input_file
if "," in self.input_file:
filename = filename[0:filename.find(',')]
with open(filename) as f:
for line in f:
m = re.match('^CommandLine flags: .*', line, flags=0)
if m:
Expand Down Expand Up @@ -319,32 +322,34 @@ def get_long_field(self, line, field, def_value=0):
return long(def_value)

def parse_log(self):
with open(self.input_file) as f:
for line in f:
# This needs to be first
self.line_has_timestamp(line)

self.line_has_gc(line)

if self.gc_alg_g1gc:
self.collect_root_scan_times(line)
self.collect_mixed_duration_times(line)
self.collect_to_space_exhaustion(line)
self.collect_humongous_objects(line)
self.collect_reclaimable(line)
self.collect_stw_sub_timings(line)

# find the occupance threshold if CommandLine log line not present
if not self.occupancy_threshold:
self.collect_occupancy_threshold_pattern(line)

if self.gc_alg_cms:
self.write_cms_data(line)

# This needs to be last
if self.line_has_pause_time(line):
self.output_data()
self.stw.reset()
files = self.input_file.split(',')
for file in files:
with open(file) as f:
for line in f:
# This needs to be first
self.line_has_timestamp(line)

self.line_has_gc(line)

if self.gc_alg_g1gc:
self.collect_root_scan_times(line)
self.collect_mixed_duration_times(line)
self.collect_to_space_exhaustion(line)
self.collect_humongous_objects(line)
self.collect_reclaimable(line)
self.collect_stw_sub_timings(line)

# find the occupance threshold if CommandLine log line not present
if not self.occupancy_threshold:
self.collect_occupancy_threshold_pattern(line)

if self.gc_alg_cms:
self.write_cms_data(line)

# This needs to be last
if self.line_has_pause_time(line):
self.output_data()
self.stw.reset()

def output_data(self):
if self.mixed_duration_count == 0:
Expand Down