GUACAMOLE-259: Merge logging of frame timing information.

This commit is contained in:
James Muehlner 2017-03-31 10:55:34 -07:00
commit 3b0b36ad5d
2 changed files with 13 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#include "user.h" #include "user.h"
#include <dlfcn.h> #include <dlfcn.h>
#include <inttypes.h>
#include <pthread.h> #include <pthread.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@ -414,6 +415,11 @@ int guac_client_end_frame(guac_client* client) {
/* Update and send timestamp */ /* Update and send timestamp */
client->last_sent_timestamp = guac_timestamp_current(); client->last_sent_timestamp = guac_timestamp_current();
/* Log received timestamp and calculated lag (at TRACE level only) */
guac_client_log(client, GUAC_LOG_TRACE, "Server completed "
"frame %" PRIu64 "ms.", client->last_sent_timestamp);
return guac_protocol_send_sync(client->socket, client->last_sent_timestamp); return guac_protocol_send_sync(client->socket, client->last_sent_timestamp);
} }

View File

@ -27,6 +27,7 @@
#include "user.h" #include "user.h"
#include "user-handlers.h" #include "user-handlers.h"
#include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
@ -124,6 +125,12 @@ int __guac_handle_sync(guac_user* user, int argc, char** argv) {
} }
/* Log received timestamp and calculated lag (at TRACE level only) */
guac_user_log(user, GUAC_LOG_TRACE,
"User confirmation of frame %" PRIu64 "ms received "
"at %" PRIu64 "ms (processing_lag=%ims)",
timestamp, current, user->processing_lag);
if (user->sync_handler) if (user->sync_handler)
return user->sync_handler(user, timestamp); return user->sync_handler(user, timestamp);
return 0; return 0;