Commit 1e84323d authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Sort components by name in HistorySvc dump

parent 4eba1583
......@@ -118,20 +118,20 @@ Algs: 1
AlgExecStateSvc VERBOSE reset(0)
EventLoopMgr DEBUG ---> Loop Finished - WSS 46.0273 | total time (skipping 1st evt) 31410 ns
ServiceManager DEBUG Stopping service HistorySvc
HistorySvc VERBOSE MessageSvc is Service
HistorySvc VERBOSE JobOptionsSvc is Service
HistorySvc VERBOSE StatusCodeSvc is Service
HistorySvc VERBOSE EventLoopMgr is Service
HistorySvc VERBOSE AlgContextSvc is Service
HistorySvc VERBOSE AlgExecStateSvc is Service
HistorySvc VERBOSE AppMgrRunable is Service
HistorySvc VERBOSE HistorySvc is Service
HistorySvc VERBOSE IncidentSvc is Service
HistorySvc VERBOSE EventDataSvc is Service
HistorySvc VERBOSE EventLoopMgr is Service
HistorySvc VERBOSE EventPersistencySvc is Service
HistorySvc VERBOSE TimelineSvc is Service
HistorySvc VERBOSE AlgExecStateSvc is Service
HistorySvc VERBOSE HistogramDataSvc is Service
HistorySvc VERBOSE HistogramPersistencySvc is Service
HistorySvc VERBOSE AlgContextSvc is Service
HistorySvc VERBOSE HistorySvc is Service
HistorySvc VERBOSE IncidentSvc is Service
HistorySvc VERBOSE JobOptionsSvc is Service
HistorySvc VERBOSE MessageSvc is Service
HistorySvc VERBOSE StatusCodeSvc is Service
HistorySvc VERBOSE TimelineSvc is Service
HistorySvc VERBOSE ToolSvc is Service
HistorySvc VERBOSE History is Alg
ServiceManager DEBUG Stopping service EventLoopMgr
......
......@@ -770,10 +770,14 @@ void HistorySvc::dumpState( std::ofstream& ofs ) const
ofs << "SERVICES" << std::endl;
}
for ( auto& item : m_svcmap ) {
const IService* svc = item.first;
dumpState( svc, ofs );
}
// helper to dump monitored components sorted by name
auto sortedDump = [&ofs, this]( const auto& map ) {
std::map<std::string, const INamedInterface*> sorted;
for ( const auto& item : map ) sorted[item.first->name()] = item.first;
for ( const auto& item : sorted ) dumpState( item.second, ofs );
};
sortedDump( m_svcmap );
if ( m_outputFileTypeXML ) {
ofs << "</SERVICES>" << endl << "<ALGORITHMS> " << endl;
......@@ -781,10 +785,7 @@ void HistorySvc::dumpState( std::ofstream& ofs ) const
ofs << "ALGORITHMS" << std::endl;
}
for ( auto& item : m_algmap ) {
const Algorithm* alg = item.first;
dumpState( alg, ofs );
}
sortedDump( m_algmap );
if ( m_outputFileTypeXML ) {
ofs << "</ALGORITHMS>" << endl << "<ALGTOOLS> " << endl;
......@@ -792,10 +793,7 @@ void HistorySvc::dumpState( std::ofstream& ofs ) const
ofs << "ALGTOOLS" << std::endl;
}
for ( auto& item : m_algtoolmap ) {
const AlgTool* algtool = item.first;
dumpState( algtool, ofs );
}
sortedDump( m_algtoolmap );
if ( m_outputFileTypeXML ) {
ofs << "</ALGTOOLS>" << endl << "</SETUP>" << endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment