Skip to content

Commit

Permalink
remove ugly legacy code, only the new dict format is supported
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@22200 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 21, 2019
1 parent 17842ef commit c5eef78
Showing 1 changed file with 6 additions and 29 deletions.
35 changes: 6 additions & 29 deletions src/xpra/client/gtk_base/session_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ def settimedeltastr(label, from_time):
delta = datetime.timedelta(seconds=(int(time.time())-int(from_time)))
label.set_text(str(delta))
if self.client.server_load:
self.server_load_label.set_text(" ".join([str(x/1000.0) for x in self.client.server_load]))
self.server_load_label.set_text(" ".join("%.1f" % (x/1000.0) for x in self.client.server_load))
if self.client.server_start_time>0:
settimedeltastr(self.session_started_label, self.client.server_start_time)
else:
Expand Down Expand Up @@ -988,10 +988,10 @@ def setlabels(labels, values, rounding=int):
setall(labels, rounded_values)

if self.client.server_ping_latency:
spl = [1000.0*x[1] for x in tuple(self.client.server_ping_latency)]
spl = tuple(int(1000*x[1]) for x in tuple(self.client.server_ping_latency))
setlabels(self.server_latency_labels, spl)
if self.client.client_ping_latency:
cpl = [1000.0*x[1] for x in tuple(self.client.client_ping_latency)]
cpl = tuple(int(1000*x[1]) for x in tuple(self.client.client_ping_latency))
setlabels(self.client_latency_labels, cpl)
if mixin_features.windows and self.client.windows_enabled:
setall(self.batch_labels, self.values_from_info("batch_delay", "batch.delay"))
Expand Down Expand Up @@ -1072,32 +1072,6 @@ def get_window_encoder_stats(self):
window_encoder_stats[wid] = encoder_stats
except:
log.error("Error: cannot lookup window dict", exc_info=True)
return window_encoder_stats
#fallback code, we are interested in string data like:
#window[1].encoder=x264
#window[1].encoder.frames=1
#window[1].encoder.fps=25
for k,v in self.client.server_last_info.items():
k = bytestostr(k)
if not k.startswith("window["):
continue
pos = k.find("].encoder")
if pos<=0:
continue
try:
wid_str = k[len("window["):pos] #ie: "1"
wid = int(wid_str)
except (TypeError, ValueError):
#wid_str may be invalid, ie:
#window[1].pipeline_option[1].encoder=video_spec(xpra.codecs.enc_x264.encoder.Encoder)
# -> wid_str= "1].pipeline_option[1"
continue
ekey = k[(pos+len("].encoder")):] #ie: "" or ".frames"
if ekey.startswith("."):
ekey = ekey[1:]
if ekey=="build_config":
continue
window_encoder_stats.setdefault(wid, {})[ekey] = v
return window_encoder_stats


Expand Down Expand Up @@ -1197,6 +1171,9 @@ def norm_lists(items, size=N_SAMPLES):
(self.avg_decoding_latency, "decoding"),
(self.avg_total, "frame total"),
))
#debug:
#for i, v in enumerate(latency_values):
# log.warn("%20s = %s", latency_labels[i], v)
surface = make_graph_imagesurface(latency_values, labels=latency_labels,
width=w, height=h,
title="Latency (ms)", min_y_scale=10, rounding=25,
Expand Down

0 comments on commit c5eef78

Please sign in to comment.