Skip to content

Commit

Permalink
3.1 release:
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
ben-spiller committed Oct 18, 2019
1 parent 0a61f30 commit 186e4ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ deploy:
skip_cleanup: true
overwrite: true
on:
branch: master
branch: release
condition: $DEPLOY_JOB = true

name: "v<VERSION>"
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
3.1
---

...
- 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.

3.0
---
Expand Down
13 changes: 7 additions & 6 deletions apamax/log_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""

__version__ = '3.1.dev'
__version__ = '3.1'
__date__ = '2019-10-18'
__author__ = "Apama community"
__license__ = "Apache 2.0"
Expand Down Expand Up @@ -456,16 +456,16 @@ def processFile(self, file):
if lastpercent < threshold:
self.handleFilePercentComplete(file=file, percent=threshold)
self.handleFileFinished(file=file)

duration = time.time()-duration
if duration > 10:
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))))

self.currentlineno = -1
self.__currentfilehandle = None
self.currentpath, self.currentpathbytes = None, 0
self.currentfile = file

duration = time.time()-duration
if duration > 10:
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))))

def handleFileFinished(self, file, **extra):
for w in self.writers:
w.closeFile()
Expand Down Expand Up @@ -1464,6 +1464,7 @@ def main(self, args):
archiveextensions['.xz'] = lzma
archiveextensions['.bz2'] = bz2
archiveextensions['.gzip'] = gzip
archiveextensions['.gz'] = gzip

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

0 comments on commit 186e4ea

Please sign in to comment.