Count messages printed inside event loop
Definition at line 624 of file CheckSteps.py.
◆ __init__()
def python.TrigValSteering.CheckSteps.MessageCountStep.__init__ |
( |
|
self, |
|
|
|
name = 'MessageCount' |
|
) |
| |
Definition at line 627 of file CheckSteps.py.
627 def __init__(self, name='MessageCount'):
628 super(MessageCountStep, self).
__init__(name)
629 self.executable =
'messageCounter.py'
630 self.log_regex =
r'(athena\.(?!.*tail).*log$|athenaHLT:.*\.out$|^log\.(.*to.*|Derivation))'
632 self.start_pattern =
r'(HltEventLoopMgr|AthenaHiveEventLoopMgr).*INFO Starting loop on events'
633 self.end_pattern =
r'(HltEventLoopMgr.*INFO All events processed|AthenaHiveEventLoopMgr.*INFO.*Loop Finished)'
634 self.print_on_fail =
None
636 self.auto_report_result =
True
637 self.depends_on_exec =
True
◆ configure()
def python.TrigValSteering.CheckSteps.MessageCountStep.configure |
( |
|
self, |
|
|
|
test |
|
) |
| |
Definition at line 639 of file CheckSteps.py.
640 self.args +=
' -s "{:s}"'.
format(self.start_pattern)
641 self.args +=
' -e "{:s}"'.
format(self.end_pattern)
642 if self.print_on_fail
is None:
643 self.print_on_fail = self.required
644 if self.print_on_fail:
645 self.args +=
' --saveAll'
647 max_events = test.exec_steps[0].max_events
if isinstance(test.exec_steps[0], ExecStep)
else 0
648 if 'WARNING' not in self.thresholds:
649 self.thresholds[
'WARNING'] = 0
650 if 'INFO' not in self.thresholds:
651 self.thresholds[
'INFO'] = max_events
652 if 'DEBUG' not in self.thresholds:
653 self.thresholds[
'DEBUG'] = 0
654 if 'VERBOSE' not in self.thresholds:
655 self.thresholds[
'VERBOSE'] = 0
656 if 'other' not in self.thresholds:
657 self.thresholds[
'other'] = max_events
658 super(MessageCountStep, self).
configure(test)
◆ run()
def python.TrigValSteering.CheckSteps.MessageCountStep.run |
( |
|
self, |
|
|
|
dry_run = False |
|
) |
| |
Definition at line 660 of file CheckSteps.py.
660 def run(self, dry_run=False):
661 files = os.listdir(
'.')
662 r = re.compile(self.log_regex)
663 log_files = [f
for f
in filter(r.match, files)
if f
not in self.skip_logs]
664 if not log_files
and not dry_run:
665 self.log.
error(
'%s found no log files matching the pattern %s', self.name, self.log_regex)
667 if self.auto_report_result:
669 return self.result,
'# (internal) {} -> failed'.
format(self.name)
670 self.args +=
' ' +
' '.
join(log_files)
671 auto_report = self.auto_report_result
672 self.auto_report_result =
False
673 ret, cmd = super(MessageCountStep, self).
run(dry_run)
674 self.auto_report_result = auto_report
676 self.log.
error(
'%s failed', self.name)
678 if self.auto_report_result:
680 return self.result, cmd
682 for log_file
in log_files:
683 json_file =
'MessageCount.{:s}.json'.
format(log_file)
684 if self.print_on_fail:
685 all_json_file =
'Messages.{:s}.json'.
format(log_file)
686 if not os.path.isfile(json_file):
687 self.log.warning(
'%s cannot open file %s', self.name, json_file)
688 with open(json_file)
as f:
689 summary = json.load(f)
690 for level, threshold
in self.thresholds.
items():
691 if summary[level] > threshold:
694 '%s Number of %s messages %s in %s is higher than threshold %s',
695 self.name, level, summary[level], log_file, threshold)
696 if self.print_on_fail:
697 self.log.
info(
'%s Printing all %s messages from %s', self.name, level, log_file)
698 with open(all_json_file)
as af:
699 all_msg = json.load(af)
700 for msg
in all_msg[level]:
703 if self.auto_report_result:
705 return self.result, cmd
◆ auto_report_result
python.TrigValSteering.CheckSteps.MessageCountStep.auto_report_result |
◆ depends_on_exec
python.TrigValSteering.CheckSteps.MessageCountStep.depends_on_exec |
◆ end_pattern
python.TrigValSteering.CheckSteps.MessageCountStep.end_pattern |
◆ executable
python.TrigValSteering.CheckSteps.MessageCountStep.executable |
◆ log_regex
python.TrigValSteering.CheckSteps.MessageCountStep.log_regex |
◆ print_on_fail
python.TrigValSteering.CheckSteps.MessageCountStep.print_on_fail |
◆ result
python.TrigValSteering.CheckSteps.MessageCountStep.result |
◆ skip_logs
python.TrigValSteering.CheckSteps.MessageCountStep.skip_logs |
◆ start_pattern
python.TrigValSteering.CheckSteps.MessageCountStep.start_pattern |
◆ thresholds
python.TrigValSteering.CheckSteps.MessageCountStep.thresholds |
The documentation for this class was generated from the following file:
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)