Count messages printed inside event loop
 
Definition at line 621 of file CheckSteps.py.
◆ __init__()
      
        
          | def python.TrigValSteering.CheckSteps.MessageCountStep.__init__ | ( |  | self, | 
        
          |  |  |  | name = 'MessageCount' | 
        
          |  | ) |  |  | 
      
 
Definition at line 624 of file CheckSteps.py.
  624     def __init__(self, name='MessageCount'):
 
  625         super(MessageCountStep, self).
__init__(name)
 
  626         self.executable = 
'messageCounter.py' 
  627         self.log_regex = 
r'(athena\.(?!.*tail).*log$|athenaHLT:.*\.out$|^log\.(.*to.*|Derivation))' 
  629         self.start_pattern = 
r'(HltEventLoopMgr|AthenaHiveEventLoopMgr).*INFO Starting loop on events' 
  630         self.end_pattern = 
r'(HltEventLoopMgr.*INFO All events processed|AthenaHiveEventLoopMgr.*INFO.*Loop Finished)' 
  631         self.print_on_fail = 
None 
  633         self.auto_report_result = 
True 
  634         self.depends_on_exec = 
True   
 
 
◆ configure()
      
        
          | def python.TrigValSteering.CheckSteps.MessageCountStep.configure | ( |  | self, | 
        
          |  |  |  | test | 
        
          |  | ) |  |  | 
      
 
Definition at line 636 of file CheckSteps.py.
  637         self.args += 
' -s "{:s}"'.
format(self.start_pattern)
 
  638         self.args += 
' -e "{:s}"'.
format(self.end_pattern)
 
  639         if self.print_on_fail 
is None:
 
  640             self.print_on_fail = self.required
 
  641         if self.print_on_fail:
 
  642             self.args += 
' --saveAll' 
  644         max_events = test.exec_steps[0].max_events 
if isinstance(test.exec_steps[0], ExecStep) 
else 0
 
  645         if 'WARNING' not in self.thresholds:
 
  646             self.thresholds[
'WARNING'] = 0
 
  647         if 'INFO' not in self.thresholds:
 
  648             self.thresholds[
'INFO'] = max_events
 
  649         if 'DEBUG' not in self.thresholds:
 
  650             self.thresholds[
'DEBUG'] = 0
 
  651         if 'VERBOSE' not in self.thresholds:
 
  652             self.thresholds[
'VERBOSE'] = 0
 
  653         if 'other' not in self.thresholds:
 
  654             self.thresholds[
'other'] = max_events
 
  655         super(MessageCountStep, self).
configure(test)
 
 
 
 
◆ run()
      
        
          | def python.TrigValSteering.CheckSteps.MessageCountStep.run | ( |  | self, | 
        
          |  |  |  | dry_run = False | 
        
          |  | ) |  |  | 
      
 
Definition at line 657 of file CheckSteps.py.
  657     def run(self, dry_run=False):
 
  658         files = os.listdir(
'.')
 
  659         r = re.compile(self.log_regex)
 
  660         log_files = [f 
for f 
in filter(r.match, files) 
if f 
not in self.skip_logs]
 
  661         if not log_files 
and not dry_run:
 
  662             self.log.
error(
'%s found no log files matching the pattern %s', self.name, self.log_regex)
 
  664             if self.auto_report_result:
 
  666             return self.result, 
'# (internal) {} -> failed'.
format(self.name)
 
  667         self.args += 
' ' + 
' '.
join(log_files)
 
  668         auto_report = self.auto_report_result
 
  669         self.auto_report_result = 
False 
  670         ret, cmd = super(MessageCountStep, self).
run(dry_run)
 
  671         self.auto_report_result = auto_report
 
  673             self.log.
error(
'%s failed', self.name)
 
  675             if self.auto_report_result:
 
  677             return self.result, cmd
 
  679         for log_file 
in log_files:
 
  680             json_file = 
'MessageCount.{:s}.json'.
format(log_file)
 
  681             if self.print_on_fail:
 
  682                 all_json_file = 
'Messages.{:s}.json'.
format(log_file)
 
  683             if not os.path.isfile(json_file):
 
  684                 self.log.warning(
'%s cannot open file %s', self.name, json_file)
 
  685             with open(json_file) 
as f:
 
  686                 summary = json.load(f)
 
  687                 for level, threshold 
in self.thresholds.
items():
 
  688                     if summary[level] > threshold:
 
  691                             '%s Number of %s messages %s in %s is higher than threshold %s',
 
  692                             self.name, level, summary[level], log_file, threshold)
 
  693                         if self.print_on_fail:
 
  694                             self.log.
info(
'%s Printing all %s messages from %s', self.name, level, log_file)
 
  695                             with open(all_json_file) 
as af:
 
  696                                 all_msg = json.load(af)
 
  697                                 for msg 
in all_msg[level]:
 
  700         if self.auto_report_result:
 
  702         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)