mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-26 20:51:49 +02:00
Add a debug-level print on the last ~second's maximum encoding time
This commit is contained in:
parent
b30318a68f
commit
99fe70bbd6
@ -155,7 +155,9 @@ static void updateMaxVideoRes(uint16_t *x, uint16_t *y) {
|
|||||||
|
|
||||||
EncodeManager::EncodeManager(SConnection* conn_, EncCache *encCache_) : conn(conn_),
|
EncodeManager::EncodeManager(SConnection* conn_, EncCache *encCache_) : conn(conn_),
|
||||||
dynamicQualityMin(-1), dynamicQualityOff(-1),
|
dynamicQualityMin(-1), dynamicQualityOff(-1),
|
||||||
areaCur(0), videoDetected(false), videoTimer(this), encCache(encCache_)
|
areaCur(0), videoDetected(false), videoTimer(this),
|
||||||
|
maxEncodingTime(0), framesSinceEncPrint(0),
|
||||||
|
encCache(encCache_)
|
||||||
{
|
{
|
||||||
StatsVector::iterator iter;
|
StatsVector::iterator iter;
|
||||||
|
|
||||||
@ -1136,9 +1138,24 @@ void EncodeManager::writeRects(const Region& changed, const PixelBuffer* pb,
|
|||||||
checkWebpFallback(start);
|
checkWebpFallback(start);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start)
|
if (start) {
|
||||||
encodingTime = msSince(start);
|
encodingTime = msSince(start);
|
||||||
|
|
||||||
|
if (vlog.getLevel() >= vlog.LEVEL_DEBUG) {
|
||||||
|
framesSinceEncPrint++;
|
||||||
|
if (maxEncodingTime < encodingTime)
|
||||||
|
maxEncodingTime = encodingTime;
|
||||||
|
|
||||||
|
if (framesSinceEncPrint >= rfb::Server::frameRate) {
|
||||||
|
vlog.info("Max encoding time during the last %u frames: %u ms (limit %u, near limit %.0f)",
|
||||||
|
framesSinceEncPrint, maxEncodingTime, 1000/rfb::Server::frameRate,
|
||||||
|
1000/rfb::Server::frameRate * 0.8f);
|
||||||
|
maxEncodingTime = 0;
|
||||||
|
framesSinceEncPrint = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (webpTookTooLong)
|
if (webpTookTooLong)
|
||||||
activeEncoders[encoderFullColour] = encoderTightJPEG;
|
activeEncoders[encoderFullColour] = encoderTightJPEG;
|
||||||
|
|
||||||
|
@ -182,6 +182,7 @@ namespace rfb {
|
|||||||
unsigned webpBenchResult;
|
unsigned webpBenchResult;
|
||||||
bool webpTookTooLong;
|
bool webpTookTooLong;
|
||||||
unsigned encodingTime;
|
unsigned encodingTime;
|
||||||
|
unsigned maxEncodingTime, framesSinceEncPrint;
|
||||||
|
|
||||||
EncCache *encCache;
|
EncCache *encCache;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user