Skip to content

Commit

Permalink
expose last refresh event info via xpra info
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@11185 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 11, 2015
1 parent 6e02b61 commit 159b6bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def __init__(self, queue_size, call_in_encode_thread, queue_packet, compressed_w
self.batch_config = batch_config
#auto-refresh:
self.auto_refresh_delay = auto_refresh_delay
self.last_auto_refresh_message = None
self.video_helper = video_helper
if window.is_shadow():
self.max_delta_size = -1
Expand Down Expand Up @@ -354,6 +355,12 @@ def up(prefix, d):
"auto-refresh" : self.client_refresh_encodings,
"rgb_formats" : self.rgb_formats,
})
larm = self.last_auto_refresh_message
if larm:
up("encodings.auto-refresh.last-event", {
"elapsed" : int(1000*(time.time()-larm[0])),
"message" : larm[1],
})
up("icons", self.icons_encoding_options)
idata = self.window_icon_data
if idata:
Expand Down Expand Up @@ -1439,6 +1446,7 @@ def make_data_packet_cb(self, window, w, h, damage_time, process_damage_time, wi
sched_delay = int(max(50, self.auto_refresh_delay * pct / 50, self.batch_config.delay*2) * qsmult / (200*100))
self.refresh_target_time = max(target_time, now + sched_delay/1000.0)
msg = "re-scheduling refresh (due in %ims, %ims added - sched_delay=%s, pct=%s, batch=%s)" % (1000*(self.refresh_target_time-now), 1000*(self.refresh_target_time-target_time), sched_delay, pct, self.batch_config.delay)
self.last_auto_refresh_message = time.time(), msg
refreshlog("auto refresh: %5s screen update (quality=%3i), %s (region=%s, refresh regions=%s)", encoding, actual_quality, msg, region, self.refresh_regions)

def remove_refresh_region(self, region):
Expand Down

0 comments on commit 159b6bf

Please sign in to comment.