Skip to content

Commit

Permalink
update for latencies for standalone makers
Browse files Browse the repository at this point in the history
  • Loading branch information
MRiganSUSX committed Oct 11, 2024
1 parent b05c8f2 commit 45905a7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 1 addition & 3 deletions plugins/CustomTCMaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion plugins/CustomTCMaker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class CustomTCMaker : public dunedaq::appfwk::DAQModule
// Create an instance of the Latency class
std::atomic<bool> m_latency_monitoring{ false };
dunedaq::trigger::Latency m_latency_instance;
std::atomic<metric_counter_type> m_latency_in{ 0 };
std::atomic<metric_counter_type> m_latency_out{ 0 };
};
} // namespace trigger
Expand Down
4 changes: 1 addition & 3 deletions plugins/RandomTCMakerModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion plugins/RandomTCMakerModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule
// Create an instance of the Latency class
std::atomic<bool> m_latency_monitoring{ false };
dunedaq::trigger::Latency m_latency_instance;
std::atomic<metric_counter_type> m_latency_in{ 0 };
std::atomic<metric_counter_type> m_latency_out{ 0 };
};
} // namespace trigger
Expand Down
9 changes: 8 additions & 1 deletion schema/trigger/opmon/latency_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 45905a7

Please sign in to comment.