Skip to content
Snippets Groups Projects

online: Fix idle time monitoring.

Merged Felix Weiglhofer requested to merge fweig/cbmroot:idle-time-fix into master
1 file
+ 9
8
Compare changes
  • Side-by-side
  • Inline
+ 9
8
@@ -24,6 +24,8 @@
using namespace cbm::algo;
namespace chron = std::chrono;
std::shared_ptr<StorableRecoResults> makeStorableRecoResults(const fles::Timeslice& ts, const RecoResults& results)
{
auto storable = std::make_shared<StorableRecoResults>(ts.index(), ts.start_time());
@@ -168,7 +170,7 @@ int main(int argc, char** argv)
Reco reco;
MemoryLogger memoryLogger;
auto startProcessing = std::chrono::high_resolution_clock::now();
auto startProcessing = chron::high_resolution_clock::now();
reco.Init(opts);
fles::TimesliceAutoSource source(opts.InputLocator());
@@ -190,7 +192,7 @@ int main(int argc, char** argv)
if (num_ts > 0) num_ts += opts.SkipTimeslices();
L_(debug) << "Starting to fetch timeslices from source...";
auto startFetchTS = std::chrono::high_resolution_clock::now();
auto startFetchTS = chron::high_resolution_clock::now();
while (auto timeslice = source.get()) {
if (tsIdx < opts.SkipTimeslices()) {
tsIdx++;
@@ -206,10 +208,9 @@ int main(int argc, char** argv)
ts = std::move(timeslice);
}
auto endFetchTS = std::chrono::high_resolution_clock::now();
auto endFetchTS = chron::high_resolution_clock::now();
auto durationFetchTS = endFetchTS - startFetchTS;
extraMonitor.timeIdle +=
std::chrono::duration_cast<std::chrono::duration<double, std::milli>>(durationFetchTS).count();
extraMonitor.timeIdle = chron::duration_cast<chron::duration<double, std::milli>>(durationFetchTS).count();
try {
RecoResults result = reco.Run(*ts);
@@ -236,14 +237,14 @@ int main(int argc, char** argv)
if (num_ts > 0 && tsIdx >= num_ts) break;
startFetchTS = std::chrono::high_resolution_clock::now();
startFetchTS = chron::high_resolution_clock::now();
}
if (archive) archive->end_stream();
reco.Finalize();
auto endProcessing = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(endProcessing - startProcessing);
auto endProcessing = chron::high_resolution_clock::now();
auto duration = chron::duration_cast<chron::milliseconds>(endProcessing - startProcessing);
L_(info) << "Total Processing time (Wall): " << duration.count() << " ms";
return 0;
Loading