Skip to content

Commit 186e4ea

Browse files
committed
3.1 release:
- Fix bug resulting in error when log analysis takes more than 10s. - Add supprot for .gz files. - Add special-case to parse apama-ctrl-* log files that don't end with .log.
1 parent 0a61f30 commit 186e4ea

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ deploy:
5555
skip_cleanup: true
5656
overwrite: true
5757
on:
58-
branch: master
58+
branch: release
5959
condition: $DEPLOY_JOB = true
6060

6161
name: "v<VERSION>"

CHANGELOG.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
3.1
22
---
3-
4-
...
3+
- Fix bug resulting in error when log analysis takes more than 10s.
4+
- Add supprot for .gz files.
5+
- Add special-case to parse apama-ctrl-* log files that don't end with .log.
56

67
3.0
78
---

apamax/log_analyzer.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
2020
"""
2121

22-
__version__ = '3.1.dev'
22+
__version__ = '3.1'
2323
__date__ = '2019-10-18'
2424
__author__ = "Apama community"
2525
__license__ = "Apache 2.0"
@@ -456,16 +456,16 @@ def processFile(self, file):
456456
if lastpercent < threshold:
457457
self.handleFilePercentComplete(file=file, percent=threshold)
458458
self.handleFileFinished(file=file)
459+
460+
duration = time.time()-duration
461+
if duration > 10:
462+
log.info('Completed analysis of %s in %s', os.path.basename(self.currentpath), (('%d seconds'%duration) if duration < 120 else ('%0.1f minutes' % (duration/60))))
459463

460464
self.currentlineno = -1
461465
self.__currentfilehandle = None
462466
self.currentpath, self.currentpathbytes = None, 0
463467
self.currentfile = file
464468

465-
duration = time.time()-duration
466-
if duration > 10:
467-
log.info('Completed analysis of %s in %s', os.path.basename(self.currentpath), (('%d seconds'%duration) if duration < 120 else ('%0.1f minutes' % (duration/60))))
468-
469469
def handleFileFinished(self, file, **extra):
470470
for w in self.writers:
471471
w.closeFile()
@@ -1464,6 +1464,7 @@ def main(self, args):
14641464
archiveextensions['.xz'] = lzma
14651465
archiveextensions['.bz2'] = bz2
14661466
archiveextensions['.gzip'] = gzip
1467+
archiveextensions['.gz'] = gzip
14671468

14681469
logpaths = set()
14691470
def raiseOnError(e):
@@ -1477,7 +1478,7 @@ def addDirectory(root):
14771478
dirnames.append('logs')
14781479
continue
14791480
for fn in filenames:
1480-
if (fn.endswith('.log') or fn.endswith('.out')) and not fn.endswith('.input.log') and not fn.startswith('iaf'):
1481+
if (fn.endswith('.log') or fn.endswith('.out') or fn.startswith('apama-ctrl-')) and not fn.endswith('.input.log') and not fn.startswith('iaf'):
14811482
logpaths.add(dirpath+os.sep+fn)
14821483
else:
14831484
log.info('Ignoring file (filename doesn\'t look like a correlator log): %s', dirpath+os.sep+fn)

0 commit comments

Comments
 (0)