The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
precedence::Duration Struct Reference

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

Collaboration diagram for precedence::Duration:

Public Member Functions

 Duration (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 336 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ Duration()

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

Definition at line 337 of file PrecedenceRulesGraph.h.

338 : m_slot( slot ), m_timelineSvc( svcLocator->service<ITimelineSvc>( "TimelineSvc", false ) ) {
339 SmartIF<IMessageSvc> msgSvc{ svcLocator };
340 MsgStream log{ msgSvc, "Duration.Getter" };
341
342 // Figure if we can discover the algorithm timings
343 if ( !m_timelineSvc.isValid() )
344 log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
345 << "algorithm's runtimes to the TTT dumps" << endmsg;
346 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
GAUDI_API ISvcLocator * svcLocator()
@ WARNING
Definition IMessageSvc.h:22
SmartIF< ITimelineSvc > m_timelineSvc

Member Function Documentation

◆ operator()() [1/3]

std::string precedence::Duration::operator() ( const AlgoProps & props) const
inline

Definition at line 348 of file PrecedenceRulesGraph.h.

348 {
349
350 std::string time;
351
352 if ( m_timelineSvc.isValid() ) {
353
354 TimelineEvent te;
355 te.algorithm = props.m_name;
356 te.slot = m_slot.eventContext->slot();
357 te.event = m_slot.eventContext->evt();
358
359 m_timelineSvc->getTimelineEvent( te );
360 time = std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( te.end - te.start ).count() );
361 }
362
363 return time;
364 }
time_point start
time_point end
std::string algorithm

◆ operator()() [2/3]

std::string precedence::Duration::operator() ( const DataProps & ) const
inline

Definition at line 368 of file PrecedenceRulesGraph.h.

368{ return ""; }

◆ operator()() [3/3]

std::string precedence::Duration::operator() ( const DecisionHubProps & ) const
inline

Definition at line 366 of file PrecedenceRulesGraph.h.

366{ return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::Duration::m_slot

Definition at line 370 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 371 of file PrecedenceRulesGraph.h.


The documentation for this struct was generated from the following file: