61 const std::chrono::milliseconds interval {250};
64 sctp startTime = scsc::now();
65 sctp stopTime = startTime + runtime;
66 sctp lastPubTime = startTime;
70 auto* pHistTest = qaData.MakeObj<H1D>(
"testHist",
"Tester source; Runtime [s]; Entries to histo [iterations]",
72 auto* pHistTrans = qaData.MakeObj<H1D>(
73 "transHist",
"Tester histos transmission time; Trans. time [ms]; Messages []", 1001, -0.025, 50.025);
77 sctp transStartTime = scsc::now();
81 auto pad1 = PadConfig();
82 pad1.SetGrid(
false,
false);
83 pad1.SetLog(
false,
false,
false);
84 pad1.RegisterHistogram(pHistTest,
"hist");
85 canv.AddPadConfig(pad1);
86 auto pad2 = PadConfig();
87 pad2.SetGrid(
true,
true);
88 pad2.SetLog(
false,
false,
false);
89 pad2.RegisterHistogram(pHistTest,
"hist");
90 canv.AddPadConfig(pad2);
91 auto pad3 = PadConfig();
92 pad3.SetGrid(
true,
true);
93 pad3.SetLog(
true,
false,
false);
94 pad3.RegisterHistogram(pHistTrans,
"hist");
95 canv.AddPadConfig(pad3);
96 auto pad4 = PadConfig();
97 pad4.SetGrid(
true,
true);
98 pad4.SetLog(
true,
false,
false);
99 pad4.RegisterHistogram(pHistTrans,
"hist");
100 pad4.RegisterHistogram(pHistTest,
"hist same");
101 canv.AddPadConfig(pad4);
102 qaData.AddCanvasConfig(canv);
106 lastPubTime = scsc::now();
109 pHistTrans->Fill(std::chrono::duration_cast<std::chrono::microseconds>(lastPubTime - transStartTime).count() / 1e3);
111 while (scsc::now() < stopTime) {
113 pHistTest->Fill(std::chrono::duration_cast<std::chrono::milliseconds>(scsc::now() - startTime).count() / 1e3);
115 if (pubint < scsc::now() - lastPubTime) {
116 LOG(info) <<
"Pub-hist: " << scsc::now().time_since_epoch().count() <<
" " << pHistTest->GetEntries();
118 transStartTime = scsc::now();
123 lastPubTime = scsc::now();
126 pHistTrans->Fill(std::chrono::duration_cast<std::chrono::microseconds>(lastPubTime - transStartTime).count()
130 std::this_thread::sleep_for(interval);
131 LOG(info) <<
"test: " << (scsc::now() < stopTime) <<
" (" << scsc::now().time_since_epoch().count() <<
" vs "
132 << stopTime.time_since_epoch().count() <<
") => "
133 << (std::chrono::duration_cast<std::chrono::milliseconds>(scsc::now() - startTime).count() / 1e3);
137 LOG(info) <<
"Pub-hist: " << scsc::now().time_since_epoch().count() <<
" " << pHistTest->GetEntries();