|
|
Go to the documentation of this file.
7 #include <boost/format.hpp>
19 desc.
addUntracked<uint32_t>(
"eventRange", 10000)->setComment(
"Preallocate a buffer for N events");
20 desc.
addUntracked<uint32_t>(
"eventResolution", 1)->setComment(
"Sample the processing time every N events");
30 descriptions.
add(
"ThroughputService", desc);
35 m_startup(
std::chrono::system_clock::
now()),
37 m_resolution(
config.getUntrackedParameter<uint32_t>(
"eventResolution")),
39 m_events(
config.getUntrackedParameter<uint32_t>(
"eventRange") / m_resolution),
40 m_print_event_summary(
config.getUntrackedParameter<
bool>(
"printEventSummary")),
41 m_enable_dqm(
config.getUntrackedParameter<
bool>(
"enableDQM")),
42 m_dqm_bynproc(m_enable_dqm ?
config.getUntrackedParameter<
bool>(
"dqmPathByProcesses") :
false),
43 m_dqm_path(m_enable_dqm ?
config.getUntrackedParameter<
std::
string>(
"dqmPath") :
""),
44 m_time_range(m_enable_dqm ?
config.getUntrackedParameter<double>(
"timeRange") : 0.),
45 m_time_resolution(m_enable_dqm ?
config.getUntrackedParameter<double>(
"timeResolution") : 0.) {
59 concurrent_streams % concurrent_threads)
69 edm::LogWarning(
"ThroughputService") <<
"The DQMStore is not avalable, the DQM plots will not be generated";
119 edm::LogWarning(
"ThroughputService") <<
"Not enough events to measure the throughput with a resolution of "
144 double throughput_avg = double(
m_resolution) / time_avg;
145 double throughput_dev = double(
m_resolution) * time_dev / time_avg / time_avg;
147 info <<
"Average throughput: " << throughput_avg <<
" ± " << throughput_dev <<
" ev/s";
const double m_time_range
dqm::reco::MonitorElement * m_sourced_events
const uint32_t m_resolution
#define DEFINE_FWK_SERVICE(type)
virtual void setCurrentFolder(std::string const &fullpath)
void postEvent(edm::StreamContext const &sc)
void preGlobalBeginRun(edm::GlobalContext const &gc)
dqm::reco::MonitorElement * m_retired_events
void preSourceEvent(edm::StreamID sid)
bool m_print_event_summary
tbb::concurrent_vector< std::chrono::system_clock::time_point > m_events
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void setXTitle(std::string const &title)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void watchPostEvent(PostEvent::slot_type const &iSlot)
unsigned int maxNumberOfThreads() const
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
virtual void setYTitle(std::string const &title)
unsigned int maxNumberOfStreams() const
std::atomic< uint32_t > m_counter
const double m_time_resolution
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::chrono::system_clock::time_point m_startup
void preallocate(edm::service::SystemBounds const &bounds)
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
ThroughputService(const edm::ParameterSet &, edm::ActivityRegistry &)
const std::string processor_model
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())