Skip to content

Commit

Permalink
[OMON-661] Remove division by 0 log message (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn authored Oct 6, 2023
1 parent 2daddd2 commit 2f917a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endif()

# Define project
project(Monitoring
VERSION 3.17.3
VERSION 3.17.4
DESCRIPTION "O2 Monitoring library"
LANGUAGES CXX
)
Expand Down
2 changes: 1 addition & 1 deletion src/DerivedMetrics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/testDerived.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ 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;
o2::monitoring::Metric metric(10, name);
derivedHandler.process(metric, DerivedMetricMode::RATE);
BOOST_CHECK_EXCEPTION(derivedHandler.process(metric, DerivedMetricMode::RATE), MonitoringException, exceptionCheck);
}
}*/

BOOST_AUTO_TEST_CASE(derivedIncrementInt)
{
Expand Down

0 comments on commit 2f917a2

Please sign in to comment.