LCOV - code coverage report
Current view: top level - opmonlib/src - BackendOpMonFacility.cpp (source / functions) Coverage Total Hit
Test: code.result Lines: 100.0 % 17 17
Test Date: 2025-12-21 13:07:08 Functions: 100.0 % 2 2

            Line data    Source code
       1              : 
       2              : #include "opmonlib/BackendOpMonFacility.hpp"
       3              : 
       4              : using namespace dunedaq::opmonlib;
       5              : 
       6          106 : void BackendOpMonFacility::publish(opmon::OpMonEntry && e) const {
       7              : 
       8          106 :   std::lock_guard<std::mutex> lk(m_mutex);
       9          106 :   m_list.push_back(e);
      10              :   
      11          106 : }
      12              : 
      13              : 
      14           21 : BackendOpMonFacility::data_t BackendOpMonFacility::get_entries(std::regex measurement_filter) {
      15              : 
      16           21 :   std::unique_lock<std::mutex> lk(m_mutex);
      17           21 :   data_t ret;
      18           21 :   m_list.swap(ret);
      19           21 :   lk.unlock();
      20              : 
      21           21 :   std::smatch values;
      22           21 :   auto it = ret.begin();
      23          125 :   while ( it != ret.end() ) {
      24          104 :     if ( ! std::regex_match( it->measurement(), values, measurement_filter) ) {
      25           81 :       it = ret.erase(it);
      26              :     } else {
      27           23 :       ++it;
      28              :     }
      29              :   }
      30              :    
      31           21 :   return ret;
      32           21 : }
        

Generated by: LCOV version 2.0-1