From a8420a43f9fbaaf15d9a4ea55be3d496c553bab8 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Fri, 23 Feb 2018 14:46:47 -0500 Subject: [PATCH] Format Read cache hits as percentage --- src/webui/api/synccontroller.cpp | 2 +- src/webui/www/private/scripts/client.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index 35704c713..570e721e7 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -122,7 +122,7 @@ namespace map[KEY_TRANSFER_TOTAL_PEER_CONNECTIONS] = sessionStatus.peersCount; qreal readRatio = cacheStatus.readRatio; - map[KEY_TRANSFER_READ_CACHE_HITS] = (readRatio >= 0) ? Utils::String::fromDouble(100 * readRatio, 2) : "-"; + map[KEY_TRANSFER_READ_CACHE_HITS] = (readRatio > 0) ? Utils::String::fromDouble(100 * readRatio, 2) : "0"; map[KEY_TRANSFER_TOTAL_BUFFERS_SIZE] = cacheStatus.totalUsedBuffers * 16 * 1024; // num_peers is not reliable (adds up peers, which didn't even overcome tcp handshake) diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 4d37d387f..cdd3dbe5c 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -395,7 +395,7 @@ window.addEvent('load', function () { $('TotalWastedSession').set('html', friendlyUnit(serverState.total_wasted_session, false)); $('GlobalRatio').set('html', serverState.global_ratio); $('TotalPeerConnections').set('html', serverState.total_peer_connections); - $('ReadCacheHits').set('html', serverState.read_cache_hits); + $('ReadCacheHits').set('html', serverState.read_cache_hits + "%"); $('TotalBuffersSize').set('html', friendlyUnit(serverState.total_buffers_size, false)); $('WriteCacheOverload').set('html', serverState.write_cache_overload + "%"); $('ReadCacheOverload').set('html', serverState.read_cache_overload + "%");