From 39da191b11931118ea30f604427f3238fe551c98 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Fri, 11 May 2018 14:44:28 +0200 Subject: [PATCH] report missing cache hit information as 0 values, not as non-representable types --- arangod/RocksDBEngine/RocksDBEngine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arangod/RocksDBEngine/RocksDBEngine.cpp b/arangod/RocksDBEngine/RocksDBEngine.cpp index 91b2c7d65a..afaaf543df 100644 --- a/arangod/RocksDBEngine/RocksDBEngine.cpp +++ b/arangod/RocksDBEngine/RocksDBEngine.cpp @@ -1913,8 +1913,9 @@ void RocksDBEngine::getStatistics(VPackBuilder& builder) const { auto rates = manager->globalHitRates(); builder.add("cache.limit", VPackValue(manager->globalLimit())); builder.add("cache.allocated", VPackValue(manager->globalAllocation())); - builder.add("cache.hit-rate-lifetime", VPackValue(rates.first)); - builder.add("cache.hit-rate-recent", VPackValue(rates.second)); + // handle NaN + builder.add("cache.hit-rate-lifetime", VPackValue(rates.first >= 0.0 ? rates.first : 0.0)); + builder.add("cache.hit-rate-recent", VPackValue(rates.second >= 0.0 ? rates.second : 0.0)); // print column family statistics builder.add("columnFamilies", VPackValue(VPackValueType::Object));