14 #include "boost/tokenizer.hpp" 17 #include <sys/types.h> 25 : actionId_(
pset.getUntrackedParameter<
int>(
"defaultAction", -1)),
26 intqualifier_(
pset.getUntrackedParameter<
int>(
"defaultQualifier", 0)),
27 qualifier2_(
pset.getUntrackedParameter<double>(
"secondQualifier", 1)),
28 actionRequired_(actionId_ != -1) {
34 timingHisto_ =
new TH1D(
"timingHisto_",
"Total time for all modules per event", 100, 0, 1000);
144 unsigned int iterations = 0;
145 if (actionRequired_) {
151 ::usleep(intqualifier_ * 1000);
157 throw cms::Exception(qualifier_) <<
"This exception was generated by the ExceptionGenerator";
184 for (
unsigned int j = 0;
j < intqualifier_ * 1000 * 100;
j++) {
189 iterations = 100 *
static_cast<unsigned int>(timingHisto_->GetRandom() * intqualifier_ * 17. + 0.5);
190 for (
unsigned int j = 0;
j < iterations;
j++) {
195 iterations =
static_cast<unsigned int>(timingHisto_->GetRandom() * intqualifier_ * 12. + 0.5);
196 TRandom3 random(iterations);
197 const size_t dataSize = 32 * 500;
198 std::vector<double>
data(dataSize);
199 random.RndmArray(dataSize, &
data[0]);
201 for (
unsigned int j = 0;
j < iterations;
j++) {
202 const size_t index =
static_cast<size_t>(random.Rndm() * dataSize + 0.5);
205 if (random.Rndm() < 0.1)
211 gettimeofday(&tv_now,
nullptr);
212 if ((
unsigned)(tv_now.tv_sec - tv_start_.tv_sec) > intqualifier_)
216 void *vp = malloc(1024);
217 #pragma GCC diagnostic push 218 #pragma GCC diagnostic ignored "-Wstringop-overflow" 219 memset((
char *)vp - 32 + intqualifier_, 0, 1024);
220 #pragma GCC diagnostic pop 226 float off = intqualifier_ * (1. - qualifier2_);
228 iterations =
static_cast<unsigned int>(
max(1., off + timingHisto_->GetRandom() *
scale));
230 ::usleep(iterations * 1000);
235 float off = intqualifier_ * (1. - qualifier2_);
237 iterations =
static_cast<unsigned int>(
max(1., off + timingHisto_->GetRandom() *
scale));
238 iterations *= 100000;
239 for (
unsigned int j = 0;
j < iterations;
j++) {
244 throw cms::Exception(
"FastMonitoringService") <<
"Random exception!";
Log< level::Error, false > LogError
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void beginRun(const edm::Run &r, const edm::EventSetup &iSetup) override
void __attribute__((optimize("O0"))) ExceptionGenerator
char data[epos_bytes_allocation]
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override