1
0
Fork 0

report missing cache hit information as 0 values, not as non-representable types

This commit is contained in:
jsteemann 2018-05-11 14:44:28 +02:00
parent 86550966ef
commit 39da191b11
1 changed files with 3 additions and 2 deletions

View File

@ -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));