mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-10 07:07:46 +02:00
Only show FL/PL percentage when it's > 1%
This commit is contained in:
@@ -127,8 +127,8 @@ export class StreamStatsCollector {
|
||||
received: 0,
|
||||
dropped: 0,
|
||||
toString() {
|
||||
const framesDroppedPercentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1);
|
||||
return framesDroppedPercentage === '0.0' ? this.dropped.toString() : `${this.dropped} (${framesDroppedPercentage}%)`;
|
||||
const percentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1);
|
||||
return percentage.startsWith('0.') ? this.dropped.toString() : `${this.dropped} (${percentage}%)`;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -136,8 +136,8 @@ export class StreamStatsCollector {
|
||||
received: 0,
|
||||
dropped: 0,
|
||||
toString() {
|
||||
const packetsLostPercentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1);
|
||||
return packetsLostPercentage === '0.0' ? this.dropped.toString() : `${this.dropped} (${packetsLostPercentage}%)`;
|
||||
const percentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1);
|
||||
return percentage.startsWith('0.') ? this.dropped.toString() : `${this.dropped} (${percentage}%)`;
|
||||
},
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user