Change to % reduced so it's more useful info (ratio is usually uncomp_size:comp_size)

This commit is contained in:
Eric MacDonald
2021-08-10 00:11:09 -04:00
committed by zefie
parent 9b25b0b860
commit 7b3b7325a7

View File

@@ -602,8 +602,8 @@ async function sendToClient(socket, headers_obj, data) {
// ultimately send original content length if lzpf // ultimately send original content length if lzpf
compressed_content_length = data.byteLength; compressed_content_length = data.byteLength;
} }
var compression_percentage = ((compressed_content_length / uncompressed_content_length) * 100).toFixed(1).toString() + "%"; var compression_percentage = ((1 - (compressed_content_length / uncompressed_content_length)) * 100).toFixed(1).toString() + "%";
if (uncompressed_content_length != compressed_content_length) if (zdebug) console.log(" # Compression stats: Orig Size:", uncompressed_content_length, "~ Comp Size:", compressed_content_length, "~ Ratio:", compression_percentage); if (uncompressed_content_length != compressed_content_length) if (zdebug) console.log(" # Compression stats: Orig Size:", uncompressed_content_length, "~ Comp Size:", compressed_content_length, "~ % Reduced:", compression_percentage);
} }
// encrypt if needed // encrypt if needed