File indexing completed on 2025-03-23 15:57:27
0001 #include "CondCore/CondDB/interface/ConnectionPool.h"
0002 #include "CondCore/CondDB/interface/IOVProxy.h"
0003 #include "CondCore/CondDB/interface/GTProxy.h"
0004
0005 #include "CondCore/Utilities/interface/Utilities.h"
0006 #include "CondCore/Utilities/interface/CondDBImport.h"
0007 #include <iostream>
0008 #include <fstream>
0009
0010 #include <atomic>
0011 #include <chrono>
0012 #include <memory>
0013
0014 #include <boost/thread/mutex.hpp>
0015 #include "oneapi/tbb/parallel_for_each.h"
0016 #include "oneapi/tbb/global_control.h"
0017
0018 namespace cond {
0019
0020 using namespace persistency;
0021
0022 class ConnectionPoolWrapper {
0023 public:
0024 ConnectionPoolWrapper(int authenticationSystem, const std::string& authenticationPath, bool debug);
0025 Session createSession(const std::string& connectionString);
0026 boost::mutex lock;
0027 ConnectionPool connPool;
0028 };
0029
0030 class UntypedPayloadProxy {
0031 public:
0032 UntypedPayloadProxy();
0033
0034 UntypedPayloadProxy(const UntypedPayloadProxy& rhs);
0035
0036 UntypedPayloadProxy& operator=(const UntypedPayloadProxy& rhs);
0037
0038 void init(Session session);
0039
0040 void load(const std::string& tag);
0041
0042 void reload();
0043
0044 void reset();
0045
0046 void disconnect();
0047
0048 TimeType timeType() const;
0049 std::string tag() const;
0050 std::string payloadType() const;
0051
0052 bool get(cond::Time_t targetTime, bool debug);
0053
0054 size_t numberOfQueries() const;
0055
0056 const std::vector<std::string>& history() const;
0057
0058 const Binary& getBuffer() const;
0059 size_t getBufferSize() const;
0060
0061 const Binary& getStreamerInfo() const;
0062
0063 void setRecordInfo(const std::string& recName, const std::string& recLabel) {
0064 m_recName = recName;
0065 m_recLabel = recLabel;
0066 }
0067
0068 const std::string recName() const { return m_recName; }
0069 const std::string recLabel() const { return m_recLabel; }
0070
0071 private:
0072 struct pimpl {
0073 cond::Iov_t current;
0074 std::vector<std::string> history;
0075 };
0076
0077 Session m_session;
0078 IOVProxy m_iov;
0079 std::shared_ptr<pimpl> m_data;
0080
0081 Binary m_buffer;
0082 Binary m_streamerInfo;
0083
0084 std::string m_recName;
0085 std::string m_recLabel;
0086
0087 };
0088
0089 class TestGTPerf : public cond::Utilities {
0090 public:
0091 TestGTPerf();
0092 int execute() override;
0093 };
0094
0095 }
0096
0097 cond::ConnectionPoolWrapper::ConnectionPoolWrapper(int authenticationSystem,
0098 const std::string& authenticationPath,
0099 bool debug) {
0100 connPool.setAuthenticationSystem(authenticationSystem);
0101 if (!authenticationPath.empty())
0102 connPool.setAuthenticationPath(authenticationPath);
0103 if (debug)
0104 connPool.setMessageVerbosity(coral::Debug);
0105 connPool.configure();
0106 }
0107
0108 cond::Session cond::ConnectionPoolWrapper::createSession(const std::string& connectionString) {
0109 Session s;
0110 {
0111 boost::mutex::scoped_lock slock(lock);
0112 s = connPool.createSession(connectionString);
0113 }
0114 return s;
0115 }
0116
0117 cond::UntypedPayloadProxy::UntypedPayloadProxy() : m_session(), m_iov(), m_data(), m_buffer() {
0118 m_data = std::make_shared<pimpl>();
0119 m_data->current.clear();
0120 }
0121
0122 cond::UntypedPayloadProxy::UntypedPayloadProxy(const UntypedPayloadProxy& rhs)
0123 : m_session(rhs.m_session), m_iov(rhs.m_iov), m_data(rhs.m_data), m_buffer(rhs.m_buffer) {}
0124
0125 cond::UntypedPayloadProxy& cond::UntypedPayloadProxy::operator=(const cond::UntypedPayloadProxy& rhs) {
0126 m_session = rhs.m_session;
0127 m_iov = rhs.m_iov;
0128 m_data = rhs.m_data;
0129 m_buffer = rhs.m_buffer;
0130 return *this;
0131 }
0132
0133 void cond::UntypedPayloadProxy::init(Session session) {
0134 m_session = session;
0135 reset();
0136 }
0137
0138 void cond::UntypedPayloadProxy::load(const std::string& tag) {
0139 m_data->current.clear();
0140 m_session.transaction().start();
0141 m_iov = m_session.readIov(tag);
0142 m_session.transaction().commit();
0143 }
0144
0145 void cond::UntypedPayloadProxy::reload() {
0146 std::string tag = m_iov.tagInfo().name;
0147 load(tag);
0148 }
0149
0150 void cond::UntypedPayloadProxy::reset() {
0151 m_iov.reset();
0152 m_data->current.clear();
0153 }
0154
0155 void cond::UntypedPayloadProxy::disconnect() { m_session.close(); }
0156
0157 std::string cond::UntypedPayloadProxy::tag() const { return m_iov.tagInfo().name; }
0158
0159 cond::TimeType cond::UntypedPayloadProxy::timeType() const { return m_iov.tagInfo().timeType; }
0160
0161 std::string cond::UntypedPayloadProxy::payloadType() const { return m_iov.tagInfo().payloadType; }
0162
0163 bool cond::UntypedPayloadProxy::get(cond::Time_t targetTime, bool debug) {
0164 bool loaded = false;
0165
0166
0167 if (targetTime < m_data->current.since || targetTime >= m_data->current.till) {
0168
0169 if (debug)
0170 std::cout << " Searching tag " << m_iov.tagInfo().name << " for a valid payload for time=" << targetTime
0171 << std::endl;
0172 m_session.transaction().start();
0173 auto iovs = m_iov.selectAll();
0174 auto iIov = iovs.find(targetTime);
0175 if (iIov == iovs.end())
0176 cond::throwException(std::string("Tag ") + m_iov.tagInfo().name +
0177 ": No iov available for the target time:" + std::to_string(targetTime),
0178 "UntypedPayloadProxy::get");
0179 m_data->current = *iIov;
0180
0181 std::string payloadType("");
0182 loaded = m_session.fetchPayloadData(m_data->current.payloadId, payloadType, m_buffer, m_streamerInfo);
0183 m_session.transaction().commit();
0184
0185 if (!loaded) {
0186 std::cout << "ERROR: payload with id " << m_data->current.payloadId << " could not be loaded." << std::endl;
0187 } else {
0188 if (debug)
0189 std::cout << "Loaded payload of type \"" << payloadType << "\" (" << m_buffer.size() << " bytes)" << std::endl;
0190 }
0191 }
0192 return loaded;
0193 }
0194
0195 size_t cond::UntypedPayloadProxy::numberOfQueries() const { return m_iov.numberOfQueries(); }
0196
0197 const std::vector<std::string>& cond::UntypedPayloadProxy::history() const { return m_data->history; }
0198
0199 size_t cond::UntypedPayloadProxy::getBufferSize() const { return m_buffer.size(); }
0200
0201 const cond::Binary& cond::UntypedPayloadProxy::getBuffer() const { return m_buffer; }
0202
0203 const cond::Binary& cond::UntypedPayloadProxy::getStreamerInfo() const { return m_streamerInfo; }
0204
0205
0206
0207 class Timer {
0208 public:
0209 Timer(const std::string& nameIn) : name(nameIn) { reset(); }
0210 void reset() {
0211 start = std::chrono::steady_clock::now();
0212 intervals.clear();
0213 intervalNames.clear();
0214 interval("start");
0215 }
0216
0217 void interval(const std::string& intName) {
0218 intervals.push_back(std::chrono::steady_clock::now());
0219 intervalNames.push_back(intName);
0220 }
0221
0222 void fetchInt(size_t sizeIn) {
0223 fetchTime.push_back(std::chrono::steady_clock::now());
0224 fetchNum.push_back(sizeIn);
0225 }
0226 void deserInt(size_t sizeIn) {
0227 deserTime.push_back(std::chrono::steady_clock::now());
0228 deserNum.push_back(sizeIn);
0229 }
0230
0231 void show(std::ostream& os = std::cout) {
0232 showIntervals(os);
0233 showFetchInfo(os);
0234 showDeserInfo(os);
0235 }
0236 void showIntervals(std::ostream& os = std::cout);
0237 void showFetchInfo(std::ostream& os = std::cout);
0238 void showDeserInfo(std::ostream& os = std::cout);
0239
0240 private:
0241 std::string name;
0242
0243 std::chrono::time_point<std::chrono::steady_clock> start;
0244
0245 std::vector<std::chrono::time_point<std::chrono::steady_clock> > intervals;
0246 std::vector<std::string> intervalNames;
0247
0248 std::vector<std::chrono::time_point<std::chrono::steady_clock> > fetchTime;
0249 std::vector<int> fetchNum;
0250
0251 std::vector<std::chrono::time_point<std::chrono::steady_clock> > deserTime;
0252 std::vector<int> deserNum;
0253 };
0254
0255 void Timer::showIntervals(std::ostream& os) {
0256 os << std::endl;
0257 os << "Serialization type: " << name << std::endl;
0258 for (size_t i = 1; i < intervals.size(); i++) {
0259 os << intervalNames[i] << " : "
0260 << std::chrono::duration<double, std::milli>(intervals[i] - intervals[i - 1]).count() << " msec. " << std::endl;
0261 }
0262 os << "\noverall time elapsed"
0263 << " : " << std::chrono::duration<double, std::milli>(intervals[intervals.size() - 1] - intervals[0]).count()
0264 << " msec. " << std::endl;
0265 os << std::endl;
0266 }
0267
0268 void Timer::showFetchInfo(std::ostream& os) {
0269 os << std::endl;
0270 os << "Serialization type: " << name << std::endl;
0271 if (fetchTime.empty()) {
0272 os << "No fetch info available." << std::endl;
0273 return;
0274 }
0275 int totSize = 0;
0276 for (size_t i = 1; i < fetchTime.size(); i++) {
0277 totSize += fetchNum[i];
0278 auto delta = std::chrono::duration<double, std::milli>(fetchTime[i] - fetchTime[i - 1]).count();
0279 os << fetchNum[i] << " : " << delta << " ms (" << float(fetchNum[i]) / (1024. * float(delta)) << " MB/s)"
0280 << std::endl;
0281 }
0282 auto deltaAll = std::chrono::duration<double, std::milli>(fetchTime[fetchTime.size() - 1] - fetchTime[0]).count();
0283 os << "\noverall time for " << totSize << " bytes : " << deltaAll << " ms ("
0284 << float(totSize) / (1024. * float(deltaAll)) << " MB/s)" << std::endl;
0285 os << std::endl;
0286 }
0287
0288 void Timer::showDeserInfo(std::ostream& os) {
0289 os << std::endl;
0290 os << "Serialization type: " << name << std::endl;
0291 if (deserTime.empty()) {
0292 os << "No deserialization info available." << std::endl;
0293 return;
0294 }
0295 int totSize = 0;
0296 for (size_t i = 1; i < deserTime.size(); i++) {
0297 totSize += deserNum[i];
0298 auto delta = std::chrono::duration<double, std::milli>(deserTime[i] - deserTime[i - 1]).count();
0299 os << deserNum[i] << " : " << delta << " ms (" << float(deserNum[i]) / (1024. * float(delta)) << " MB/s)"
0300 << std::endl;
0301 }
0302 auto deltaAll = std::chrono::duration<double, std::milli>(deserTime[deserTime.size() - 1] - deserTime[0]).count();
0303 os << "\noverall time for " << totSize << " bytes : " << deltaAll << " ms ("
0304 << float(totSize) / (1024. * float(deltaAll)) << " MB/s)" << std::endl;
0305 os << std::endl;
0306 }
0307
0308
0309
0310 cond::TestGTPerf::TestGTPerf() : Utilities("conddb_test_gt_load") {
0311 addConnectOption("connect", "c", "database connection string(required)");
0312 addAuthenticationOptions();
0313 addOption<size_t>("iterations", "n", "number of iterations (default=10)");
0314 addOption<Time_t>("start_run", "R", "start for Run iterations (default=150005)");
0315 addOption<Time_t>("step_run", "r", "step for Run iterations (default=1000)");
0316 addOption<Time_t>("start_ts", "T", "start for TS iterations (default=5800013687234232320)");
0317 addOption<Time_t>("step_ts", "t", "step for TS iterations (default=10000000000000)");
0318 addOption<Time_t>("start_lumi", "L", "start for Lumi iterations (default=908900979179966)");
0319 addOption<Time_t>("step_lumi", "l", "step for Lumi iterations (default=10000000000)");
0320 addOption<std::string>("globaltag", "g", "global tag (required)");
0321 addOption<bool>("verbose", "v", "verbose print out (optional)");
0322 addOption<int>("n_fetch", "f", "number of threads to load payloads (default=1)");
0323 addOption<int>("n_deser", "d", "number of threads do deserialize payloads (default=1)");
0324 }
0325
0326
0327
0328
0329 std::atomic<int> fooGlobal = 0;
0330
0331 class FetchWorker {
0332 private:
0333 cond::ConnectionPoolWrapper& connectionPool;
0334 std::string connectionString;
0335 cond::UntypedPayloadProxy* p;
0336 std::map<std::string, size_t>* requests;
0337 cond::Time_t runSel;
0338 cond::Time_t lumiSel;
0339 cond::Time_t tsSel;
0340
0341 boost::mutex my_lock;
0342
0343 public:
0344 FetchWorker(cond::ConnectionPoolWrapper& connPool,
0345 const std::string& connString,
0346 cond::UntypedPayloadProxy* pIn,
0347 std::map<std::string, size_t>* reqIn,
0348 const cond::Time_t& run,
0349 const cond::Time_t& lumi,
0350 const cond::Time_t& ts)
0351 : connectionPool(connPool),
0352 connectionString(connString),
0353 p(pIn),
0354 requests(reqIn),
0355 runSel(run),
0356 lumiSel(lumi),
0357 tsSel(ts) {}
0358
0359 void run() { runReal(); }
0360
0361 void runFake() { fooGlobal++; }
0362 void runReal() {
0363 bool debug = false;
0364 bool loaded = false;
0365 cond::time::TimeType ttype = p->timeType();
0366 auto r = requests->find(p->tag());
0367 cond::Session s;
0368 try {
0369 s = connectionPool.createSession(connectionString);
0370 p->init(s);
0371 p->reload();
0372 if (ttype == cond::runnumber) {
0373 p->get(runSel, debug);
0374 boost::mutex::scoped_lock slock(my_lock);
0375 r->second++;
0376 } else if (ttype == cond::lumiid) {
0377 p->get(lumiSel, debug);
0378 boost::mutex::scoped_lock slock(my_lock);
0379 r->second++;
0380 } else if (ttype == cond::timestamp) {
0381 p->get(tsSel, debug);
0382 boost::mutex my_lock;
0383 r->second++;
0384 } else {
0385 std::cout << "WARNING: iov request on tag " << p->tag()
0386 << " (timeType=" << cond::time::timeTypeName(p->timeType()) << ") has been skipped." << std::endl;
0387 }
0388 s.close();
0389
0390 } catch (const cond::Exception& e) {
0391 std::cout << "ERROR:" << e.what() << std::endl;
0392 }
0393 }
0394 };
0395
0396 class DeserialWorker {
0397 private:
0398 cond::UntypedPayloadProxy* p;
0399 std::shared_ptr<void> payload;
0400 boost::mutex my_lock;
0401
0402 public:
0403 DeserialWorker(cond::UntypedPayloadProxy* pIn, std::shared_ptr<void>& plIn) : p(pIn), payload(plIn) {}
0404
0405 void run() { runReal(); }
0406
0407 void runFake() { fooGlobal++; }
0408 void runReal() {
0409 std::shared_ptr<void> payloadPtr;
0410 std::string payloadTypeName = p->payloadType();
0411 const cond::Binary& buffer = p->getBuffer();
0412 const cond::Binary& streamerInfo = p->getStreamerInfo();
0413
0414 auto result = std::make_unique<std::pair<std::string, std::shared_ptr<void> > >(
0415 cond::persistency::fetchOne(payloadTypeName, buffer, streamerInfo, payloadPtr));
0416 payload = result->second;
0417
0418 return;
0419 }
0420 };
0421
0422 template <typename T>
0423 struct invoker {
0424 void operator()(T& it) const { it->run(); }
0425 };
0426
0427 int cond::TestGTPerf::execute() {
0428 std::string gtag = getOptionValue<std::string>("globaltag");
0429 std::string connect = getOptionValue<std::string>("connect");
0430 bool verbose = hasOptionValue("verbose");
0431
0432 int nThrF = getOptionValue<int>("n_fetch");
0433 int nThrD = getOptionValue<int>("n_deser");
0434 std::cout << "\n++> going to use " << nThrF << " threads for loading, " << nThrD << " threads for deserialization. \n"
0435 << std::endl;
0436
0437 std::string serType = "unknown";
0438 if (connect.find("CMS_CONDITIONS") != -1) {
0439 serType = "ROOT-5";
0440 } else if (connect.find("CMS_TEST_CONDITIONS") != -1) {
0441 serType = "boost";
0442 }
0443
0444 Time_t startRun = 150005;
0445 if (hasOptionValue("start_run"))
0446 startRun = getOptionValue<Time_t>("start_run");
0447 Time_t startTs = 5800013687234232320;
0448 if (hasOptionValue("start_ts"))
0449 startTs = getOptionValue<Time_t>("start_ts");
0450 Time_t startLumi = 908900979179966;
0451 if (hasOptionValue("start_lumi"))
0452 startLumi = getOptionValue<Time_t>("start_lumi");
0453
0454 std::string authPath("");
0455 if (hasOptionValue("authPath"))
0456 authPath = getOptionValue<std::string>("authPath");
0457
0458 initializePluginManager();
0459
0460 Timer timex(serType);
0461
0462 ConnectionPoolWrapper connPool(1, authPath, hasDebug());
0463 Session session = connPool.createSession(connect);
0464 session.transaction().start();
0465
0466 std::cout << "Loading Global Tag " << gtag << std::endl;
0467 GTProxy gt = session.readGlobalTag(gtag);
0468
0469 session.transaction().commit();
0470
0471 std::cout << "Loading " << gt.size() << " tags..." << std::endl;
0472 std::vector<UntypedPayloadProxy*> proxies;
0473 std::map<std::string, size_t> requests;
0474 for (const auto& t : gt) {
0475 UntypedPayloadProxy* p = new UntypedPayloadProxy;
0476 p->init(session);
0477 try {
0478 p->load(t.tagName());
0479 if (nThrF == 1) {
0480 p->setRecordInfo(t.recordName(), t.recordLabel());
0481 }
0482 proxies.push_back(p);
0483 requests.insert(std::make_pair(t.tagName(), 0));
0484 } catch (const cond::Exception& e) {
0485 std::cout << "ERROR: " << e.what() << std::endl;
0486 }
0487 }
0488 std::cout << proxies.size() << " tags successfully loaded." << std::endl;
0489 timex.interval("loading iovs");
0490
0491 Time_t run = startRun;
0492 Time_t lumi = startLumi;
0493 Time_t ts = startTs;
0494
0495 if (nThrF > 1)
0496 session.transaction().commit();
0497
0498 tbb::global_control init(tbb::global_control::max_allowed_parallelism, nThrF);
0499 std::vector<std::shared_ptr<FetchWorker> > tasks;
0500
0501 std::string payloadTypeName;
0502 for (auto p : proxies) {
0503 payloadTypeName = p->payloadType();
0504
0505 if ((payloadTypeName == "SiPixelGainCalibrationOffline")
0506 ) {
0507 std::cout << "WARNING: Ignoring problematic payload of type " << payloadTypeName << std::endl;
0508 continue;
0509 }
0510
0511 if (nThrF > 1) {
0512 auto fw =
0513 std::make_shared<FetchWorker>(connPool, connect, p, (std::map<std::string, size_t>*)&requests, run, lumi, ts);
0514 tasks.push_back(fw);
0515 } else {
0516 bool loaded = false;
0517 time::TimeType ttype = p->timeType();
0518 auto r = requests.find(p->tag());
0519 try {
0520 if (ttype == runnumber) {
0521 p->get(run, hasDebug());
0522 r->second++;
0523 } else if (ttype == lumiid) {
0524 p->get(lumi, hasDebug());
0525 r->second++;
0526 } else if (ttype == timestamp) {
0527 p->get(ts, hasDebug());
0528 r->second++;
0529 } else {
0530 std::cout << "WARNING: iov request on tag " << p->tag() << " (timeType=" << time::timeTypeName(p->timeType())
0531 << ") has been skipped." << std::endl;
0532 }
0533 timex.fetchInt(p->getBufferSize());
0534 } catch (const cond::Exception& e) {
0535 std::cout << "ERROR:" << e.what() << std::endl;
0536 }
0537 }
0538 }
0539
0540 tbb::parallel_for_each(tasks.begin(), tasks.end(), invoker<std::shared_ptr<FetchWorker> >());
0541
0542 std::cout << "global counter : " << fooGlobal << std::endl;
0543
0544 if (nThrF == 1)
0545 session.transaction().commit();
0546
0547
0548 timex.interval("loading payloads");
0549
0550 size_t totBufSize = 0;
0551 for (auto p : proxies) {
0552 totBufSize += p->getBufferSize();
0553 }
0554 std::cout << "++> total buffer size used : " << totBufSize << std::endl;
0555
0556 std::vector<std::shared_ptr<void> > payloads;
0557 payloads.resize(400);
0558
0559 std::shared_ptr<void> payloadPtr;
0560
0561 tbb::global_control initD(tbb::global_control::max_allowed_parallelism, nThrD);
0562 std::vector<std::shared_ptr<DeserialWorker> > tasksD;
0563
0564 timex.interval("setup deserialization");
0565
0566 int nEmpty = 0;
0567 int nBig = 0;
0568 int index = 0;
0569 for (auto p : proxies) {
0570
0571
0572
0573
0574
0575
0576 payloadTypeName = p->payloadType();
0577
0578
0579 if ((payloadTypeName == "SiPixelGainCalibrationForHLT") or
0580 (payloadTypeName == "SiPixelGainCalibrationOffline")
0581 or (payloadTypeName == "DTKeyedConfig") or (payloadTypeName == "std::vector<unsigned long long>") or
0582 (payloadTypeName == " AlignmentSurfaceDeformations")
0583
0584 or (payloadTypeName == "PhysicsTools::Calibration::MVAComputerContainer") or
0585 (payloadTypeName == "PhysicsTools::Calibration::MVAComputerContainer") or
0586 (payloadTypeName == "PhysicsTools::Calibration::MVAComputerContainer") or
0587 (payloadTypeName == "PhysicsTools::Calibration::MVAComputerContainer")) {
0588 std::cout << "INFO: Ignoring payload of type " << payloadTypeName << std::endl;
0589 continue;
0590 }
0591
0592 if (nThrD > 1) {
0593 auto dw = std::make_shared<DeserialWorker>(p, payloads[index]);
0594 tasksD.push_back(dw);
0595 } else {
0596 try {
0597 std::pair<std::string, std::shared_ptr<void> > result =
0598 fetchOne(payloadTypeName, p->getBuffer(), p->getStreamerInfo(), payloadPtr);
0599 payloads.push_back(result.second);
0600 } catch (const cond::Exception& e) {
0601 std::cout << "\nERROR (cond): " << e.what() << std::endl;
0602 std::cout << "for payload type name: " << payloadTypeName << std::endl;
0603 } catch (const std::exception& e) {
0604 std::cout << "\nERROR (boost/std): " << e.what() << std::endl;
0605 std::cout << "for payload type name: " << payloadTypeName << std::endl;
0606 }
0607 timex.deserInt(p->getBufferSize());
0608 }
0609 index++;
0610 }
0611 std::cout << std::endl;
0612
0613 tbb::parallel_for_each(tasksD.begin(), tasksD.end(), invoker<std::shared_ptr<DeserialWorker> >());
0614
0615 timex.interval("deserializing payloads");
0616
0617 std::cout << "global counter : " << fooGlobal << std::endl;
0618 std::cout << "found " << nEmpty << " empty payloads while deserialising " << std::endl;
0619
0620 std::cout << std::endl;
0621 std::cout << "*** End of job." << std::endl;
0622 std::cout << "*** GT: " << gtag << " Tags:" << gt.size() << " Loaded:" << proxies.size() << std::endl;
0623 std::cout << std::endl;
0624 for (auto p : proxies) {
0625 auto r = requests.find(p->tag());
0626 if (verbose) {
0627 std::cout << "*** Tag: " << p->tag() << " Requests processed:" << r->second << " Queries:" << p->numberOfQueries()
0628 << std::endl;
0629 const std::vector<std::string>& hist = p->history();
0630 for (const auto& e : p->history())
0631 std::cout << " " << e << std::endl;
0632 }
0633 }
0634
0635
0636
0637
0638 timex.interval("postprocessing ... ");
0639 timex.showIntervals();
0640
0641 if (nThrF == 1) {
0642 std::ofstream ofs("fetchInfo.txt");
0643 timex.showFetchInfo(ofs);
0644 std::ofstream ofs2("sizeInfo.txt");
0645 for (auto p : proxies) {
0646 ofs2 << p->payloadType() << "[" << p->recName() << ":" << p->recLabel() << "]"
0647 << " : " << p->getBufferSize() << std::endl;
0648 }
0649 }
0650 if (nThrD == 1) {
0651 std::ofstream ofs1("deserializeInfo.txt");
0652 timex.showDeserInfo(ofs1);
0653 }
0654
0655 return 0;
0656 }
0657
0658
0659
0660 int main(int argc, char** argv) {
0661
0662
0663
0664 cond::TestGTPerf test;
0665 return test.run(argc, argv);
0666 }