From 45905a792a25e6bf4cab8f552f7be639ce80fba6 Mon Sep 17 00:00:00 2001 From: MRiganSUSX Date: Fri, 11 Oct 2024 14:54:05 +0200 Subject: [PATCH] update for latencies for standalone makers --- plugins/CustomTCMaker.cpp | 4 +--- plugins/CustomTCMaker.hpp | 1 - plugins/RandomTCMakerModule.cpp | 4 +--- plugins/RandomTCMakerModule.hpp | 1 - schema/trigger/opmon/latency_info.proto | 9 ++++++++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/CustomTCMaker.cpp b/plugins/CustomTCMaker.cpp index c7e28a8..81ff44f 100644 --- a/plugins/CustomTCMaker.cpp +++ b/plugins/CustomTCMaker.cpp @@ -109,9 +109,8 @@ CustomTCMaker::generate_opmon_data() this->publish(std::move(info)); if ( m_latency_monitoring.load() && m_running_flag.load() ) { - opmon::TriggerLatency lat_info; + opmon::TriggerLatencyStandalone lat_info; - lat_info.set_latency_in( m_latency_instance.get_latency_in() ); lat_info.set_latency_out( m_latency_instance.get_latency_out() ); this->publish(std::move(lat_info)); @@ -251,7 +250,6 @@ CustomTCMaker::send_trigger_candidates() } triggeralgs::TriggerCandidate candidate = create_candidate(m_next_trigger_timestamp, m_tc_timestamps.front().first); - if (m_latency_monitoring.load()) m_latency_instance.update_latency_in( candidate.time_candidate ); m_tc_made_count++; TLOG_DEBUG(1) << get_name() << " at timestamp " << m_timestamp_estimator->get_timestamp_estimate() diff --git a/plugins/CustomTCMaker.hpp b/plugins/CustomTCMaker.hpp index 0b13348..e3a26dc 100644 --- a/plugins/CustomTCMaker.hpp +++ b/plugins/CustomTCMaker.hpp @@ -121,7 +121,6 @@ class CustomTCMaker : public dunedaq::appfwk::DAQModule // Create an instance of the Latency class std::atomic m_latency_monitoring{ false }; dunedaq::trigger::Latency m_latency_instance; - std::atomic m_latency_in{ 0 }; std::atomic m_latency_out{ 0 }; }; } // namespace trigger diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index a12b0a3..ea41c70 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -77,9 +77,8 @@ RandomTCMakerModule::generate_opmon_data() this->publish(std::move(info)); if ( m_latency_monitoring.load() && m_running_flag.load() ) { - opmon::TriggerLatency lat_info; + opmon::TriggerLatencyStandalone lat_info; - lat_info.set_latency_in( m_latency_instance.get_latency_in() ); lat_info.set_latency_out( m_latency_instance.get_latency_out() ); this->publish(std::move(lat_info)); @@ -224,7 +223,6 @@ RandomTCMakerModule::send_trigger_candidates() next_trigger_timestamp = m_timestamp_estimator->get_timestamp_estimate(); triggeralgs::TriggerCandidate candidate = create_candidate(next_trigger_timestamp); - if (m_latency_monitoring.load()) m_latency_instance.update_latency_in( candidate.time_candidate ); m_tc_made_count++; TLOG_DEBUG(1) << get_name() << " at timestamp " << m_timestamp_estimator->get_timestamp_estimate() diff --git a/plugins/RandomTCMakerModule.hpp b/plugins/RandomTCMakerModule.hpp index f79e43f..5dc7698 100644 --- a/plugins/RandomTCMakerModule.hpp +++ b/plugins/RandomTCMakerModule.hpp @@ -107,7 +107,6 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule // Create an instance of the Latency class std::atomic m_latency_monitoring{ false }; dunedaq::trigger::Latency m_latency_instance; - std::atomic m_latency_in{ 0 }; std::atomic m_latency_out{ 0 }; }; } // namespace trigger diff --git a/schema/trigger/opmon/latency_info.proto b/schema/trigger/opmon/latency_info.proto index 7069f7b..9e38243 100644 --- a/schema/trigger/opmon/latency_info.proto +++ b/schema/trigger/opmon/latency_info.proto @@ -4,10 +4,17 @@ package dunedaq.trigger.opmon; // Message for latency variables // Latency represents the difference between current system (clock) time and the data time of particular (TX) data object -// Units are ms +// Units are us // Used by many trigger modules message TriggerLatency { uint32 latency_in = 1; uint32 latency_out = 2; } +// Message for latency variables +// Latency represents the difference between current system (clock) time and the data time of particular (TX) data object +// Units are us +// Special case for Standalone makers +message TriggerLatencyStandalone { + uint32 latency_out = 1; +}