1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-05 11:24:15 +00:00

Format Read cache hits as percentage

This commit is contained in:
Thomas Piccirello 2018-02-23 14:46:47 -05:00
parent 5c2f698cb4
commit a8420a43f9
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ namespace
map[KEY_TRANSFER_TOTAL_PEER_CONNECTIONS] = sessionStatus.peersCount; map[KEY_TRANSFER_TOTAL_PEER_CONNECTIONS] = sessionStatus.peersCount;
qreal readRatio = cacheStatus.readRatio; 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; 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) // num_peers is not reliable (adds up peers, which didn't even overcome tcp handshake)

View File

@ -395,7 +395,7 @@ window.addEvent('load', function () {
$('TotalWastedSession').set('html', friendlyUnit(serverState.total_wasted_session, false)); $('TotalWastedSession').set('html', friendlyUnit(serverState.total_wasted_session, false));
$('GlobalRatio').set('html', serverState.global_ratio); $('GlobalRatio').set('html', serverState.global_ratio);
$('TotalPeerConnections').set('html', serverState.total_peer_connections); $('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)); $('TotalBuffersSize').set('html', friendlyUnit(serverState.total_buffers_size, false));
$('WriteCacheOverload').set('html', serverState.write_cache_overload + "%"); $('WriteCacheOverload').set('html', serverState.write_cache_overload + "%");
$('ReadCacheOverload').set('html', serverState.read_cache_overload + "%"); $('ReadCacheOverload').set('html', serverState.read_cache_overload + "%");