mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-23 19:21:26 +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) {
|
||||
bstats[BS_CPU_SLOW].push_back(lastRealUpdate);
|
||||
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) {
|
||||
bstats[BS_CPU_CLOSE].push_back(lastRealUpdate);
|
||||
bstats_total[BS_CPU_CLOSE]++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user