The Gaudi Framework  v36r9p1 (5c15b2bb)
precedence::EndTime Struct Reference

#include </builds/gaudi/Gaudi/GaudiHive/src/PRGraph/PrecedenceRulesGraph.h>

Collaboration diagram for precedence::EndTime:

Public Member Functions

 EndTime (const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator)
 
std::string operator() (const AlgoProps &props) const
 
std::string operator() (const DecisionHubProps &) const
 
std::string operator() (const DataProps &) const
 

Public Attributes

const EventSlotm_slot
 
SmartIF< ITimelineSvcm_timelineSvc
 

Detailed Description

Definition at line 301 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ EndTime()

precedence::EndTime::EndTime ( const EventSlot slot,
SmartIF< ISvcLocator > &  svcLocator 
)
inline

Definition at line 302 of file PrecedenceRulesGraph.h.

302  : m_slot( slot ) {
304  MsgStream log{ msgSvc, "EndTime.Getter" };
305 
306  // Figure if we can discover the algorithm timings
307  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
308  if ( !m_timelineSvc.isValid() )
309  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
310  << "algorithm completion time to the TTT dumps" << endmsg;
311  }

Member Function Documentation

◆ operator()() [1/3]

std::string precedence::EndTime::operator() ( const AlgoProps props) const
inline

Definition at line 313 of file PrecedenceRulesGraph.h.

313  {
314 
315  std::string endTime;
316 
317  if ( m_timelineSvc.isValid() ) {
318 
319  TimelineEvent te{};
320  te.algorithm = props.m_name;
321  te.slot = m_slot.eventContext->slot();
322  te.event = m_slot.eventContext->evt();
323 
324  m_timelineSvc->getTimelineEvent( te );
325  endTime =
326  std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end.time_since_epoch() ).count() );
327  }
328 
329  return endTime;
330  }

◆ operator()() [2/3]

std::string precedence::EndTime::operator() ( const DataProps ) const
inline

Definition at line 334 of file PrecedenceRulesGraph.h.

334 { return ""; }

◆ operator()() [3/3]

std::string precedence::EndTime::operator() ( const DecisionHubProps ) const
inline

Definition at line 332 of file PrecedenceRulesGraph.h.

332 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::EndTime::m_slot

Definition at line 336 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::EndTime::m_timelineSvc

Definition at line 337 of file PrecedenceRulesGraph.h.


The documentation for this struct was generated from the following file:
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:83
precedence::EndTime::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:337
std::string
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:28
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
TimelineEvent
Definition: ITimelineSvc.h:23
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:72
ITimelineSvc
Definition: ITimelineSvc.h:37
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:51
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:97
std::to_string
T to_string(T... args)
SmartIF< IMessageSvc >
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
MsgStream
Definition: MsgStream.h:34
ProduceConsume.props
props
Definition: ProduceConsume.py:84
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:31
AsyncIncidents.msgSvc
msgSvc
Definition: AsyncIncidents.py:34
precedence::EndTime::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:336
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:50