From e8eb8f49543d6cfc43d218649701f5dcd0f56978 Mon Sep 17 00:00:00 2001
From: "se.gorbunov" <se.gorbunov@gsi.de>
Date: Thu, 1 Feb 2024 11:27:09 +0000
Subject: [PATCH] Ca: fix online monitoring time scale

---
 algo/ca/core/utils/CaTimer.h | 3 +++
 algo/global/Reco.cxx         | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/algo/ca/core/utils/CaTimer.h b/algo/ca/core/utils/CaTimer.h
index 712cb4806d..90b519164e 100644
--- a/algo/ca/core/utils/CaTimer.h
+++ b/algo/ca/core/utils/CaTimer.h
@@ -69,6 +69,9 @@ namespace cbm::algo::ca
     /// \brief Gets total time [s]
     double GetTotal() const { return static_cast<double>(fTotal) * 1.e-9; }
 
+    /// \brief Gets total time [ms]
+    double GetTotalMs() const { return GetTotal() * 1.e3; }
+
     /// \brief Resets the timer
     void Reset();
 
diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx
index 4cde9b4217..14f61de9fd 100644
--- a/algo/global/Reco.cxx
+++ b/algo/global/Reco.cxx
@@ -381,9 +381,9 @@ void Reco::QueueTrackingMetrics(const ca::TrackingMonitorData& monitor)
   }
 
   GetMonitor().QueueMetric("cbmreco", {{"hostname", fles::system::current_hostname()}, {"child", Opts().ChildId()}},
-                           {{"caRecoTimeTotal", monitor.GetTimer(ca::ETimer::FindTracks).GetTotal()},
-                            {"caTrackFinderTime", monitor.GetTimer(ca::ETimer::TrackFinder).GetTotal()},
-                            {"caTrackFitterTime", monitor.GetTimer(ca::ETimer::TrackFitter).GetTotal()},
+                           {{"caRecoTimeTotal", monitor.GetTimer(ca::ETimer::FindTracks).GetTotalMs()},
+                            {"caTrackFinderTime", monitor.GetTimer(ca::ETimer::TrackFinder).GetTotalMs()},
+                            {"caTrackFitterTime", monitor.GetTimer(ca::ETimer::TrackFitter).GetTotalMs()},
                             {"caNofRecoTracks", monitor.GetCounterValue(ca::ECounter::RecoTrack)},
                             {"caNofRecoHitsTotal", monitor.GetCounterValue(ca::ECounter::RecoHit)},
                             {"caNofRecoHitsUsed", monitor.GetCounterValue(ca::ECounter::RecoHitUsed)},
-- 
GitLab