The Gaudi Framework  master (9f3f8895)
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 EventSlot & m_slot
SmartIF< ITimelineSvc > m_timelineSvc

Detailed Description

Definition at line 339 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ Duration()

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

Definition at line 340 of file PrecedenceRulesGraph.h.

341 : m_slot( slot ), m_timelineSvc( svcLocator->service<ITimelineSvc>( "TimelineSvc", false ) ) {
342 SmartIF<IMessageSvc> msgSvc{ svcLocator };
343 MsgStream log{ msgSvc, "Duration.Getter" };
344
345 // Figure if we can discover the algorithm timings
346 if ( !m_timelineSvc.isValid() )
347 log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to add "
348 << "algorithm's runtimes to the TTT dumps" << endmsg;
349 }
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 351 of file PrecedenceRulesGraph.h.

351 {
352
353 std::string time;
354
355 if ( m_timelineSvc.isValid() ) {
356
357 TimelineEvent te;
358 te.algorithm = props.m_name;
359 te.slot = m_slot.eventContext->slot();
360 te.event = m_slot.eventContext->evt();
361
362 // Calculate duration that is the difference between stop and and start for given algorithm. Asynchronous
363 // algorithms will have multiple TimelineEvents, so the start should be taken from the first and the end from
364 // the last.
365 m_timelineSvc->getFirstMatching( te );
366 auto start = te.start;
367 m_timelineSvc->getLastMatching( te );
368 auto end = te.end;
369 time = std::to_string( std::chrono::duration_cast<std::chrono::nanoseconds>( end - start ).count() );
370 }
371
372 return time;
373 }
time_point start
time_point end
std::string algorithm

◆ operator()() [2/3]

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

Definition at line 377 of file PrecedenceRulesGraph.h.

377{ return ""; }

◆ operator()() [3/3]

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

Definition at line 375 of file PrecedenceRulesGraph.h.

375{ return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::Duration::m_slot

Definition at line 379 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::Duration::m_timelineSvc

Definition at line 380 of file PrecedenceRulesGraph.h.


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