Improve recording of timing for different data analysis steps

This commit is contained in:
2026-03-26 15:19:49 +01:00
parent 2d3c87e41e
commit 0eacee0801
20 changed files with 147 additions and 23 deletions

View File

@@ -37,9 +37,14 @@ void MXAnalysisAfterFPGA::ReadFromFPGA(const DeviceOutput *output, const SpotFin
if (state == State::Disabled || !find_spots || !settings.enable) {
state = State::Disabled;
} else {
const auto t0 = std::chrono::steady_clock::now();
StrongPixelSet strong_pixel_set;
strong_pixel_set.ReadFPGAOutput(experiment, *output);
strong_pixel_set.FindSpots(experiment, settings, spots, module_number);
const auto t1 = std::chrono::steady_clock::now();
spot_finding_time_total += (t1 - t0);
spot_finding_timing_active = true;
state = State::Enabled;
}
}
@@ -97,6 +102,15 @@ void MXAnalysisAfterFPGA::Process(DataMessage &message, const SpotFindingSetting
if (spot_finding_settings.indexing)
indexer.ProcessImage(message, spot_finding_settings, message.image, *prediction);
}
if (spot_finding_timing_active) {
// total spot-finding time for the whole image
message.spot_finding_time_s = spot_finding_time_total.count() / 1e6;
// report/store ms here
spot_finding_time_total = std::chrono::duration<double, std::micro>{0.0};
spot_finding_timing_active = false;
}
spots.clear();
state = State::Idle;
}