Gaudi Auditor implementation to hook algorithm executions and notify the Trigger Cost Service.
More...
#include <TrigCostAuditor.h>
|
| | TrigCostAuditor (const std::string &name, ISvcLocator *svcloc) |
| | Standard Gaudi Auditor constructor.
|
| virtual StatusCode | initialize () override |
| | Initialise auditor.
|
| virtual StatusCode | finalize () override |
| | Does nothing.
|
| virtual void | before (const std::string &event, const std::string &caller, const EventContext &ctx) override |
| | Audit before an algorithm standard event type is called.
|
| virtual void | after (const std::string &event, const std::string &caller, const EventContext &ctx, const StatusCode &sc) override |
| | Audit after an algorithm standard event type is called.
|
| bool | msgLvl (const MSG::Level lvl) const |
| | Test the output level.
|
| void | setLevel (MSG::Level lvl) |
| | Change the current logging level.
|
|
| void | callService (const std::string &caller, ITrigCostSvc::AuditType type, const EventContext &ctx) |
| | Performs internal call to the trigger cost service.
|
| MsgStream & | msg () const |
| | The standard message stream.
|
| MsgStream & | msg (const MSG::Level lvl) const |
| | The standard message stream.
|
| void | initMessaging () const |
| | Initialize our message level and MessageSvc.
|
|
| ServiceHandle< ITrigCostSvc > | m_trigCostSvcHandle |
| std::string | m_nm |
| | Message source name.
|
| boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| | MsgStream instance (a std::cout like with print-out levels)
|
| std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| | MessageSvc pointer.
|
| std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| | Current logging level.
|
| std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| | Messaging initialized (initMessaging)
|
Gaudi Auditor implementation to hook algorithm executions and notify the Trigger Cost Service.
Only monitors the Execute event type.
Definition at line 21 of file TrigCostAuditor.h.
◆ TrigCostAuditor()
| TrigCostAuditor::TrigCostAuditor |
( |
const std::string & | name, |
|
|
ISvcLocator * | svcloc ) |
Standard Gaudi Auditor constructor.
- Parameters
-
| [in] | name | The algorithm object's name |
| [in] | svcloc | A pointer to a service location service |
Definition at line 11 of file TrigCostAuditor.cxx.
11 :
12Auditor(name, pSvcLocator),
14{
16}
AthMessaging()
Default constructor:
msgSvc
Provide convenience handles for various services.
◆ after()
| void TrigCostAuditor::after |
( |
const std::string & | event, |
|
|
const std::string & | caller, |
|
|
const EventContext & | ctx, |
|
|
const StatusCode & | sc ) |
|
overridevirtual |
Audit after an algorithm standard event type is called.
- Parameters
-
| [in] | evt | The event type. Only Execute is monitored |
| [in] | caller | The name of the calling algorithm |
| [in] | ctx | Event context |
| [in] | sc | StatusCode of algorithm execution |
Definition at line 45 of file TrigCostAuditor.cxx.
46 {
47 if (event != IAuditor::Execute) return;
50}
void callService(const std::string &caller, ITrigCostSvc::AuditType type, const EventContext &ctx)
Performs internal call to the trigger cost service.
◆ before()
| void TrigCostAuditor::before |
( |
const std::string & | event, |
|
|
const std::string & | caller, |
|
|
const EventContext & | ctx ) |
|
overridevirtual |
Audit before an algorithm standard event type is called.
- Parameters
-
| [in] | evt | The event type. Only Execute is monitored |
| [in] | caller | The name of the calling algorithm |
| [in] | ctx | Event context |
Definition at line 35 of file TrigCostAuditor.cxx.
36 {
37 if (event != IAuditor::Execute) return;
40
41}
◆ callService()
| void TrigCostAuditor::callService |
( |
const std::string & | caller, |
|
|
ITrigCostSvc::AuditType | type, |
|
|
const EventContext & | ctx ) |
|
private |
Performs internal call to the trigger cost service.
- Parameters
-
| [in] | caller | Name of algorithm being audited |
| [in] | type | AuditType::Before or AuditType::After depending on if the start or stop of execution |
| [in] | ctx | Event context |
Definition at line 54 of file TrigCostAuditor.cxx.
55 {
57 ATH_MSG_FATAL(
"Error in TrigCostSvc called by TrigCostAuditor, auditing algorithm: " << caller);
58 throw std::runtime_error("TrigCostAuditor exception");
59 }
60}
ServiceHandle< ITrigCostSvc > m_trigCostSvcHandle
◆ finalize()
| StatusCode TrigCostAuditor::finalize |
( |
| ) |
|
|
overridevirtual |
Does nothing.
- Returns
- Success
Definition at line 28 of file TrigCostAuditor.cxx.
28 {
30 return StatusCode::SUCCESS;
31}
◆ initialize()
| StatusCode TrigCostAuditor::initialize |
( |
| ) |
|
|
overridevirtual |
Initialise auditor.
Return handle to Trigger Cost Service
- Returns
- Success if service handle obtained
Definition at line 20 of file TrigCostAuditor.cxx.
20 {
23 return StatusCode::SUCCESS;
24}
#define ATH_CHECK
Evaluate an expression and check for errors.
◆ initMessaging()
| void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
40{
42
43 if (
m_lvl == MSG::NIL) {
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)
◆ msg() [1/2]
| MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineprivate |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 92 of file AthMessaging.h.
164{
166 if (!ms) {
170 }
171
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.
◆ msg() [2/2]
| MsgStream & AthMessaging::msg |
( |
const MSG::Level | lvl | ) |
const |
|
inlineprivate |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 99 of file AthMessaging.h.
179{
return msg() << lvl; }
MsgStream & msg() const
The standard message stream.
◆ msgLvl()
| bool AthMessaging::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
| lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
| true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
152{
155 return true;
156 } else {
157 return false;
158 }
159}
MsgStream & msg() const
The standard message stream.
◆ setLevel()
| void AthMessaging::setLevel |
( |
MSG::Level | lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
| std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_imsg
| std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
| std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
| boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
| std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_trigCostSvcHandle
Initial value:{ this, "TrigCostSvc", "TrigCostSvc",
"The trigger cost service to pass audit information to" }
Definition at line 76 of file TrigCostAuditor.h.
76 { this, "TrigCostSvc", "TrigCostSvc",
77 "The trigger cost service to pass audit information to" };
The documentation for this class was generated from the following files: