From 3ae2af3a11ed84ecb54566792c5e4e4bbbbc8ed9 Mon Sep 17 00:00:00 2001 From: Adam Wegrzynek Date: Fri, 6 Oct 2023 11:17:06 +0200 Subject: [PATCH 1/2] [OMON-661] Remove division by 0 log message --- CMakeLists.txt | 2 +- src/DerivedMetrics.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a583a92..1c0f3bd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ endif() # Define project project(Monitoring - VERSION 3.17.3 + VERSION 3.17.4 DESCRIPTION "O2 Monitoring library" LANGUAGES CXX ) diff --git a/src/DerivedMetrics.cxx b/src/DerivedMetrics.cxx index bc9405bd..de633886 100644 --- a/src/DerivedMetrics.cxx +++ b/src/DerivedMetrics.cxx @@ -80,7 +80,7 @@ bool DerivedMetrics::process(Metric& metric, DerivedMetricMode mode) int timestampCount = timestampDifference.count(); // disallow dividing by 0 if (timestampCount == 0) { - throw MonitoringException("DerivedMetrics", "Division by 0 when calculating rate for: " + metric.getName() + "/" + metric.getFirstValue().first); + //throw MonitoringException("DerivedMetrics", "Division by 0 when calculating rate for: " + metric.getName() + "/" + metric.getFirstValue().first); } auto current = metric.getFirstValue().second; From b50ea13f80e1972a9b93efa2d138f30b7b43f6b4 Mon Sep 17 00:00:00 2001 From: Adam Wegrzynek Date: Fri, 6 Oct 2023 11:21:55 +0200 Subject: [PATCH 2/2] Comment test --- test/testDerived.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testDerived.cxx b/test/testDerived.cxx index 5e35578f..16037ce1 100644 --- a/test/testDerived.cxx +++ b/test/testDerived.cxx @@ -171,7 +171,7 @@ bool exceptionCheck(const MonitoringException& e) return false; } -BOOST_AUTO_TEST_CASE(divisionByZero) +/*BOOST_AUTO_TEST_CASE(divisionByZero) { std::string name("test"); o2::monitoring::DerivedMetrics derivedHandler; @@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE(divisionByZero) derivedHandler.process(metric, DerivedMetricMode::RATE); BOOST_CHECK_EXCEPTION(derivedHandler.process(metric, DerivedMetricMode::RATE), MonitoringException, exceptionCheck); -} +}*/ BOOST_AUTO_TEST_CASE(derivedIncrementInt) {