26#include <boost/functional/hash.hpp>
27#include <tbb/concurrent_unordered_map.h>
31 using extends::extends;
53 tbb::concurrent_unordered_multimap<key_type, TimelineEvent, boost::hash<key_type>>
m_events;
69 out <<
"#start end algorithm thread slot event" <<
std::endl;
101 newTimelineEvent.algorithm =
std::move( alg );
102 newTimelineEvent.slot = ctx.slot();
103 newTimelineEvent.event = ctx.evt();
104 TimelineRecorder recorder{ newTimelineEvent };
107 out << std::chrono::duration_cast<std::chrono::nanoseconds>( newTimelineEvent.start.time_since_epoch() ).count()
110 <<
" " << newTimelineEvent.algorithm <<
" " << newTimelineEvent.thread <<
" " << newTimelineEvent.slot <<
" "
122 if (
begin ==
end ) {
return false; }
131 if (
begin ==
end ) {
return false; }
141 out <<
"#start end algorithm thread slot event" <<
std::endl;
144 flat_events.reserve(
m_events.size() );
148 std::sort( flat_events.begin(), flat_events.end(), [](
const auto& a,
const auto& b ) { return a.start < b.start; } );
149 for (
const auto& e : flat_events ) {
150 out << std::chrono::duration_cast<std::chrono::nanoseconds>( e.start.time_since_epoch() ).count() <<
" "
152 << e.algorithm <<
" " << e.thread <<
" " << e.slot <<
" " << e.event <<
std::endl;
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
constexpr __enable_if_is_duration< _ToDur > duration_cast(const duration< _Rep, _Period > &__d)
complex< _Tp > log(const complex< _Tp > &)
constexpr tuple< typename __decay_and_strip< _Elements >::__type... > make_tuple(_Elements &&... __args)
constexpr _OI move(_II __first, _II __last, _OI __result)
constexpr _ForwardIterator min_element(_ForwardIterator __first, _ForwardIterator __last)
constexpr void sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
constexpr _ForwardIterator max_element(_ForwardIterator __first, _ForwardIterator __last)
constexpr back_insert_iterator< _Container > back_inserter(_Container &__x)
basic_ostream< _CharT, _Traits > & endl(basic_ostream< _CharT, _Traits > &__os)
constexpr auto begin(_Container &__cont) -> decltype(__cont.begin())
constexpr auto end(_Container &__cont) -> decltype(__cont.end())
static const openmode out
static const openmode app
static const openmode trunc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
This class represents an entry point to all the event specific data.
Implementation of property with value of concrete type.
const ValueType & value() const
RAII helper to record timeline events.
Definition of the MsgStream class used to transmit messages.
const std::string & name() const override
Retrieve name of the service.
StatusCode initialize() override
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
Gaudi::Property< bool > m_isEnabled
Gaudi::Property< bool > m_partial
bool getTimelineEvent(TimelineEvent &) const override
StatusCode initialize() override
StatusCode reinitialize() override
bool getFirstMatching(TimelineEvent &) const override
StatusCode finalize() override
Gaudi::Property< std::string > m_timelineFile
bool isEnabled() const override
std::tuple< std::string, std::size_t > key_type
TimelineRecorder getRecorder(std::string alg, const EventContext &ctx) override
Gaudi::Property< bool > m_dumpTimeline
bool getLastMatching(TimelineEvent &) const override
tbb::concurrent_unordered_multimap< key_type, TimelineEvent, boost::hash< key_type > > m_events
Base class used to extend a class implementing other interfaces.