Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 680cfe1

Browse files
author
Eric Abbott
committed
filter out the seconds since jvm start from being considered a valid date/time
1 parent d7b8b21 commit 680cfe1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gc_log_visualizer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class LogParser:
2020
humongousObjectPattern = '.*request concurrent cycle initiation, .*, allocation request: ([0-9]*) .*, source: concurrent humongous allocation]'
2121

2222
def __init__(self, input_file):
23+
self.timestamp = None
2324
self.input_file = input_file
2425
self.pause_file = open('pause.dat', "w+b")
2526
self.pause_count_file = open('pause_count.dat', "w+b")
@@ -221,7 +222,7 @@ def line_has_timestamp(self, line):
221222
if t:
222223
t = t[:-1]
223224

224-
if t:
225+
if t and len(t) > 15: # 15 is mildly arbitrary
225226
try:
226227
self.timestamp = dateutil.parser.parse(t)
227228
except (ValueError, AttributeError), e:
@@ -282,12 +283,12 @@ def collect_mixed_duration_times(self, line):
282283

283284
def collect_to_space_exhaustion(self, line):
284285
m = re.match(LogParser.exhaustionPattern, line, flags=0)
285-
if m:
286+
if m and self.timestamp:
286287
self.exhaustion_file.write("%s %s\n" % (self.timestamp_string(), 100))
287288

288289
def collect_humongous_objects(self, line):
289290
m = re.match(LogParser.humongousObjectPattern, line, flags=0)
290-
if m:
291+
if m and self.timestamp:
291292
self.humongous_objects_file.write("%s %s\n" % (self.timestamp_string(), int(m.group(1)) / 1024))
292293

293294
def line_has_gc(self, line):

0 commit comments

Comments
 (0)