mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2026-07-18 00:45:51 +00:00
Have stats react faster to big cpu lag spikes
This commit is contained in:
parent
99fe70bbd6
commit
bb71cd4ec4
1 changed files with 11 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue