Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: chrome/test/vr/perf/latency/motopho_thread.py

Issue 2823883003: Make VR latency results compatible with perf dashboard, refactor into classes (Closed)
Patch Set: windows -> win Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/vr/perf/latency/motopho_thread.py
diff --git a/chrome/test/vr/perf/latency/motopho_thread.py b/chrome/test/vr/perf/latency/motopho_thread.py
new file mode 100644
index 0000000000000000000000000000000000000000..8281300f0ebb27bbddc2a87719ad4721e614871b
--- /dev/null
+++ b/chrome/test/vr/perf/latency/motopho_thread.py
@@ -0,0 +1,46 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import logging
+import subprocess
+import threading
+
+class MotophoThread(threading.Thread):
+ """Handles the running of the Motopho script and extracting results."""
+ def __init__(self):
+ threading.Thread.__init__(self)
+ self._latency = None
+ self._max_correlation = None
+
+ def run(self):
+ motopho_output = ""
+ try:
+ motopho_output = subprocess.check_output(["./motophopro_nograph"],
+ stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ logging.error('Failed to run Motopho script: %s', e.output)
+ raise e
+
+ if "FAIL" in motopho_output:
+ logging.error('Failed to get latency, logging raw output: %s',
+ motopho_output)
+ raise RuntimeError('Failed to get latency - correlation likely too low')
+
+ self._latency = None
+ self._max_correlation = None
+ for line in motopho_output.split("\n"):
+ if 'Motion-to-photon latency:' in line:
+ self._latency = float(line.split(" ")[-2])
+ if 'Max correlation is' in line:
+ self._max_correlation = float(line.split(' ')[-1])
+ if self._latency and self._max_correlation:
+ break;
+
+ @property
+ def latency(self):
+ return self._latency
+
+ @property
+ def max_correlation(self):
+ return self._max_correlation

Powered by Google App Engine
This is Rietveld 408576698