mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-24 03:31:39 +02:00
Have stats react faster to big cpu lag spikes
This commit is contained in:
parent
99fe70bbd6
commit
bb71cd4ec4
@ -1259,6 +1259,17 @@ void VNCSConnectionST::writeDataUpdate()
|
|||||||
if (ms >= limit) {
|
if (ms >= limit) {
|
||||||
bstats[BS_CPU_SLOW].push_back(lastRealUpdate);
|
bstats[BS_CPU_SLOW].push_back(lastRealUpdate);
|
||||||
bstats_total[BS_CPU_SLOW]++;
|
bstats_total[BS_CPU_SLOW]++;
|
||||||
|
|
||||||
|
// If it was several frames' worth, add several so as to react faster
|
||||||
|
int i = ms / limit;
|
||||||
|
i--;
|
||||||
|
for (; i > 0; i--) {
|
||||||
|
bstats[BS_CPU_SLOW].push_back(lastRealUpdate);
|
||||||
|
bstats_total[BS_CPU_SLOW]++;
|
||||||
|
|
||||||
|
bstats[BS_FRAME].push_back(lastRealUpdate);
|
||||||
|
bstats_total[BS_FRAME]++;
|
||||||
|
}
|
||||||
} else if (ms >= limit * 0.8f) {
|
} else if (ms >= limit * 0.8f) {
|
||||||
bstats[BS_CPU_CLOSE].push_back(lastRealUpdate);
|
bstats[BS_CPU_CLOSE].push_back(lastRealUpdate);
|
||||||
bstats_total[BS_CPU_CLOSE]++;
|
bstats_total[BS_CPU_CLOSE]++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user