This commit is contained in:
lhdamiani
2021-07-20 17:22:49 +02:00
13 changed files with 142 additions and 37 deletions
+6 -3
View File
@@ -7,9 +7,9 @@ using namespace chrono;
AssemblerStats::AssemblerStats(
const std::string &detector_name,
const size_t stats_modulo) :
const size_t stats_time) :
detector_name_(detector_name),
stats_modulo_(stats_modulo)
stats_time_(stats_time)
{
reset_counters();
}
@@ -32,7 +32,10 @@ void AssemblerStats::record_stats(
n_corrupted_images_++;
}
if (image_counter_ == stats_modulo_) {
const auto time_passed = duration_cast<milliseconds>(
steady_clock::now()-stats_interval_start_).count();
if (time_passed >= stats_time_*1000) {
print_stats();
reset_counters();
}
+1 -1
View File
@@ -86,7 +86,7 @@ int main (int argc, char *argv[])
sizeof(ImageMetadata), IMAGE_N_BYTES, 1,
buffer_config::RAM_BUFFER_N_SLOTS);
AssemblerStats stats(config.detector_name, ASSEMBLER_STATS_MODULO);
AssemblerStats stats(config.detector_name, STATS_TIME);
uint64_t image_id = 0;