Go to the documentation of this file.
70 virtual void flush(
bool isStop ) = 0;
78 m_flushThread = std::thread{ [this, flushStop = m_flushThreadStop.get_future()]() {
79 using namespace std::chrono_literals;
80 while ( flushStop.wait_for( m_autoFlushPeriod.value() * 1s ) == std::future_status::timeout ) {
89 m_flushThreadStop.set_value();
90 if ( m_flushThread.joinable() ) m_flushThread.join();
99 template <
typename Callable>
109 template <
typename Callable>
112 applyToAllEntities( [&sortedEntities](
auto& ent ) { sortedEntities.
emplace_back( &ent ); } );
113 std::sort( sortedEntities.
begin(), sortedEntities.
end(), [](
const auto* lhs,
const auto* rhs ) {
114 return std::tie( lhs->component, lhs->name ) < std::tie( rhs->component, rhs->name );
116 for (
auto const* ent : sortedEntities ) {
func( ent->component, ent->name, *ent ); }
123 const std::regex regex( searchName );
124 return std::regex_match( name, regex );
131 return lhs.
id() < rhs.
id();
136 this,
"NamesToSave", {},
"List of regexps used to match names of entities to save" };
138 this,
"ComponentsToSave", {},
"List of regexps used to match component names of entities to save" };
140 this,
"TypesToSave", {},
"List of regexps used to match type names of entities to save" };
146 this,
"AutoFlushPeriod", 0.,
147 "if different from 0, indicates every how many seconds to force a write of the FSR data to OutputFile (this "
148 "parameter makes sense only if used in conjunction with OutputFile)" };
std::set< Gaudi::Monitoring::Hub::Entity, EntityOrder > m_monitoringEntities
Interface reporting services must implement.
Base class for all Sinks registering to the Monitoring Hub Should be extended by actual Sinks.
std::thread m_flushThread
Handling of regular flushes, if requested.
std::string name
name of the entity
StatusCode initialize() override
Gaudi::Property< std::vector< std::string > > m_namesToSave
void removeEntity(Hub::Entity const &ent) override
handles removal of an entity
list of entities we are dealing with
Gaudi::Property< std::vector< std::string > > m_componentsToSave
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
StatusCode start() override
Gaudi::Property< float > m_autoFlushPeriod
bool operator()(const Gaudi::Monitoring::Hub::Entity &lhs, const Gaudi::Monitoring::Hub::Entity &rhs) const
void registerEntity(Hub::Entity ent) override
handles registration of a new entity
StatusCode initialize() override
StatusCode stop() override
StatusCode start() override
Gaudi::Property< std::vector< std::string > > m_typesToSave
AttribStringParser::Iterator begin(const AttribStringParser &parser)
const ValueType & value() const
void applyToAllSortedEntities(Callable func) const
applies a callable to all monitoring entities ordered by component the callable will be called once p...
void * id() const
unique identifier, actually mapped to internal pointer
T emplace_back(T... args)
StatusCode stop() override
virtual void flush(bool isStop)=0
pure virtual method to be defined by children and responsible for flushing current data of the Sink.
Service(std::string name, ISvcLocator *svcloc)
Standard Constructor
void applyToAllEntities(Callable func) const
applies a callable to all monitoring entities
bool wanted(std::string const &name, std::vector< std::string > const &searchNames)
deciding whether a given name matches the list of regexps given empty list means everything matches
Wrapper class for arbitrary monitoring objects.
Implementation of property with value of concrete type.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator
std::string type
type of the entity, see comment above concerning its format and usage
std::string component
name of the component owning the Entity
std::promise< void > m_flushThreadStop