From 7b3b7325a714cded93ee5f04c9b9a13da8076f7c Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Tue, 10 Aug 2021 00:11:09 -0400 Subject: [PATCH] Change to % reduced so it's more useful info (ratio is usually uncomp_size:comp_size) --- zefie_wtvp_minisrv/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index fa4463a7..e2fb3417 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -602,8 +602,8 @@ async function sendToClient(socket, headers_obj, data) { // ultimately send original content length if lzpf compressed_content_length = data.byteLength; } - var compression_percentage = ((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); + 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, "~ % Reduced:", compression_percentage); } // encrypt if needed