Skip to content

Commit

Permalink
fix a couple of minor todos
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-spiller committed Jan 14, 2022
1 parent 6cf159f commit 5190bf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions apamax/log_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,16 @@ def preProcessUserStatusLine(self, file, line, m, userStatusPrefix, userStatusCo
keyedUserStatusAccumulatedMetadata['currentBlockKeys'].add( (id, key) )

# this dict instructs handleRawStatusLine how to populate self.userStatus
userStatusConfig = { # TODO: could pre-compute or cache this to avoid having to re-construct for each line
try:
userStatusConfigPerId = userStatusConfig[f'cachedForId.{id}']
except KeyError: # first time we hit this id it needs to be created
userStatusConfigPerId = { # TODO: could pre-compute or cache this to avoid having to re-construct for each line
'fieldPrefix':columnPrefix+str(id)+'.',
'field:alias':userStatusConfig['field:alias'],
'computedRates': userStatusConfig['computedRates'],
}
return userStatusConfig
}
userStatusConfig[f'cachedForId.{id}'] = userStatusConfigPerId
return userStatusConfigPerId

def handleRawStatusLine(self, file, line, userStatusConfig=None, **extra):
"""
Expand Down Expand Up @@ -915,8 +919,6 @@ def decideColumns(status):
# now add on any user-defined status keys; always add these regardless of whether they're yet set,
# since they may come from EPL code that hasn't been injected yet and we can't change the columns later
for msgPrefix, userConfig in self.args.userStatusLines.items():
# TODO: add logic for skipping '<apama-ctrl>' msgPrefixes only if we're in in apama-ctrl file

if msgPrefix[0].startswith('<apama-ctrl> ') and (not file['isApamaCtrl']) and 'true'!=os.getenv('APAMA_LOG_ANALYZER_ASSUME_APAMACTRL',''):
log.info('Not adding column for this prefix as this does not appear to be an apama-ctrl log file by line no #%d: %s', line.lineno, msgPrefix[0])
continue
Expand Down
2 changes: 1 addition & 1 deletion tests/correctness/Cor_020/pysystest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__pysys_title__ = r""" Status lines - apama-ctrl CepServlet Proxy Status"""
__pysys_title__ = r""" Status lines - apama-ctrl CepServlet Proxy Status and HTML chart"""
# ================================================================================

__pysys_purpose__ = r"""
Expand Down

0 comments on commit 5190bf3

Please sign in to comment.