Skip to content
Snippets Groups Projects
Commit 90f38d8f authored by Illya Shapoval's avatar Illya Shapoval
Browse files

fix registration of Timeline Events in the TimelineSvc

parent fb3faa4c
No related branches found
No related tags found
1 merge request!610Allow updating of registered Timeline Event records
......@@ -59,8 +59,22 @@ StatusCode TimelineSvc::finalize()
void TimelineSvc::registerTimelineEvent( const TimelineEvent& e )
{
// if event exists refresh/augment its fields
bool eventExists = false;
for ( auto& candidate : m_events ) {
if ( candidate.algorithm == e.algorithm && candidate.event == e.event ) {
candidate.start = e.start;
candidate.end = e.end;
candidate.slot = e.slot;
candidate.thread = e.thread;
eventExists = true;
break;
}
}
m_events.push_back( e );
// register new event if not found in the previous step
if ( !eventExists ) m_events.push_back( e );
if ( m_partial ) {
std::ofstream out( m_timelineFile + ".part", std::ofstream::app | std::ofstream::out );
......
......@@ -598,7 +598,11 @@ StatusCode Algorithm::sysExecute( const EventContext& ctx )
status = exceptionSvc()->handle( *this );
}
if ( UNLIKELY( m_doTimeline ) ) timeline.end = Clock::now();
if ( UNLIKELY( m_doTimeline ) ) {
timeline.end = Clock::now();
// finalize already registered event with algorithm completion time point
timelineSvc()->registerTimelineEvent( timeline );
}
if ( status.isFailure() ) {
// Increment the error count
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment