mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
Fix inaccurate percentages of PL & FL stats
This commit is contained in:
parent
889717be7d
commit
5facfd2348
@ -196,13 +196,15 @@ class StreamStats {
|
|||||||
|
|
||||||
// Packets Lost
|
// Packets Lost
|
||||||
const packetsLost = stat.packetsLost;
|
const packetsLost = stat.packetsLost;
|
||||||
const packetsReceived = stat.packetsReceived || 1;
|
const packetsReceived = stat.packetsReceived;
|
||||||
StreamStats.#$pl.textContent = `${packetsLost} (${(packetsLost * 100 / packetsReceived).toFixed(2)}%)`;
|
const packetsLostPercentage = (packetsLost * 100 / ((packetsLost + packetsReceived) || 1)).toFixed(2);
|
||||||
|
StreamStats.#$pl.textContent = `${packetsLost} (${packetsLostPercentage}%)`;
|
||||||
|
|
||||||
// Frames Dropped
|
// Frames Dropped
|
||||||
const framesDropped = stat.framesDropped;
|
const framesDropped = stat.framesDropped;
|
||||||
const framesReceived = stat.framesReceived || 1;
|
const framesReceived = stat.framesReceived;
|
||||||
StreamStats.#$fl.textContent = `${framesDropped} (${(framesDropped * 100 / framesReceived).toFixed(2)}%)`;
|
const framesDroppedPercentage = (framesDropped * 100 / ((framesDropped + framesReceived) || 1)).toFixed(2);
|
||||||
|
StreamStats.#$fl.textContent = `${framesDropped} (${framesDroppedPercentage}%)`;
|
||||||
|
|
||||||
if (StreamStats.#lastStat) {
|
if (StreamStats.#lastStat) {
|
||||||
const lastStat = StreamStats.#lastStat;
|
const lastStat = StreamStats.#lastStat;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user