xpra icon
Bug tracker and wiki

Ticket #795: perf_config_default.py

File perf_config_default.py, 7.8 KB (added by Nick Centanni, 5 years ago)

Default test_measure_perf config file, which can be replaced on the command line with alternates.

Line 
1#!/usr/bin/env python
2import sys
3import os.path
4
5#the glx tests:
6GLX_SPHERES = ["/usr/bin/glxspheres"]
7GLX_GEARS = ["/usr/bin/glxgears", "-geometry", "1240x900"]
8NO_SHAPING = (0, 0, 0)
9
10#the plain X11 tests:
11X11_PERF = ["/usr/bin/x11perf", "-resize", "-all"]
12XTERM_TEST = ["/usr/bin/xterm", "-geometry", "160x60", "-e", "while true; do dmesg; done"]
13FAKE_CONSOLE_USER_TEST = ["/usr/bin/xterm", "-geometry", "160x60", "-e", "PYTHONPATH=`pwd` ./tests/xpra/simulate_console_user.py"]
14
15#the screensaver tests:
16XSCREENSAVERS_PATH = "/usr/libexec/xscreensaver"
17
18#games
19NEXUIZ_TEST = ["/usr/bin/nexuiz-glx", "-benchmark", "demos/demo1", "-nosound"]
20XONOTIC_TEST = ["/opt/Xonotic/xonotic-linux64-glx", "-basedir", "/opt/Xonotic", "-benchmark", "demos/the-big-keybench"]
21
22VLC_BIN = "/usr/bin/vlc"
23MPLAYER_BIN = "/usr/bin/mplayer"
24
25class Config():
26    def __init__(self):
27        def screensaver(x):
28            for d in [os.path.join(sys.prefix, "bin"), XSCREENSAVERS_PATH, "/usr/bin", "/usr/local/bin"]:
29                f = os.path.join(d, x)
30                if os.path.exists(f) and os.path.isfile(f):
31                    return f
32            return  None
33
34        ALL_SCREENSAVER_TESTS = [screensaver(x) for x in ["rss-glx-lattice", "rss-glx-plasma", "deluxe", "eruption", "memscroller", "moebiusgears", "polytopes"]]
35        SOME_SCREENSAVER_TESTS = [screensaver(x) for x in ["memscroller", "eruption", "xmatrix"]]
36        SOME_SCREENSAVER_TESTS = [screensaver(x) for x in ["memscroller", "moebiusgears", "polytopes", "rss-glx-lattice"]]
37
38        #our selection:
39        self.TEST_CANDIDATES = [screensaver("deluxe")]
40        self.TEST_CANDIDATES = self.X11_TESTS + SOME_SCREENSAVER_TESTS + self.GAMES_TESTS
41        self.TEST_CANDIDATES = self.GLX_TESTS + self.X11_TESTS + ALL_SCREENSAVER_TESTS + self.GAMES_TESTS
42        self.TEST_CANDIDATES = self.GLX_TESTS + self.X11_TESTS + ALL_SCREENSAVER_TESTS + self.SOUND_TESTS + self.VIDEO_TESTS + self.GAMES_TESTS
43
44        hank = None
45
46    CUSTOM_PARAMS = []
47    TEST_CANDIDATES = []
48
49    IP = "127.0.0.1"            #this is your IP
50    PORT = 10000                #the port to test on
51    DISPLAY_NO = 10             #the test DISPLAY no to use
52    START_SERVER = True         #if False, you are responsible for starting it
53                                #and the data will not be available
54   
55    SETTLE_TIME = 3             #how long to wait before we start measuring
56    MEASURE_TIME = 10          #run for N seconds
57    COLLECT_STATS_TIME = 10     #collect statistics every N seconds
58    SERVER_SETTLE_TIME = 3      #how long we wait for the server to start
59    DEFAULT_TEST_COMMAND_SETTLE_TIME = 1    #how long we wait after starting the test command
60                                            #this is the default value, some tests may override this below
61
62    TEST_XPRA = True
63    TEST_VNC = False            #WARNING: VNC not tested recently, probably needs updating
64    USE_IPTABLES = False        #this requires iptables to be setup so we can use it for accounting
65    USE_VIRTUALGL = True        #allows us to run GL games and benchmarks using the GPU
66    PREVENT_SLEEP = True
67
68    LIMIT_TESTS = 1         #to limit the number of tests being run
69    MAX_ERRORS = 100            #allow this many tests to cause errors before aborting
70
71    #TRICKLE_SHAPING_OPTIONS = [NO_SHAPING]
72    #TRICKLE_SHAPING_OPTIONS = [NO_SHAPING, (1024, 1024, 20)]
73    #TRICKLE_SHAPING_OPTIONS = [(1024, 1024, 20), (128, 32, 40), (0, 0, 0)]
74    #TRICKLE_SHAPING_OPTIONS = [NO_SHAPING, (1024, 256, 20), (1024, 256, 300), (128, 32, 100), (32, 8, 200)]
75    #TRICKLE_SHAPING_OPTIONS = [NO_SHAPING, (1024, 256, 20), (256, 64, 50), (128, 32, 100), (32, 8, 200)]
76    TRICKLE_SHAPING_OPTIONS = [NO_SHAPING]
77
78    GLX_TESTS = [GLX_SPHERES, GLX_GEARS]
79
80    GTKPERF_TEST = "bash -c 'while true; do gtkperf -a; done'"
81    #X11_TESTS = [X11_PERF, FAKE_CONSOLE_USER_TEST, GTKPERF_TEST]
82    X11_TESTS = [X11_PERF, XTERM_TEST, FAKE_CONSOLE_USER_TEST, GTKPERF_TEST]
83
84    XPRA_USE_PASSWORD = False
85
86    #some commands (games especially) may need longer to startup:
87    TEST_COMMAND_SETTLE_TIME = {}
88
89    #games tests:
90    #for more info, see here: http://dri.freedesktop.org/wiki/Benchmarking
91    TEST_COMMAND_SETTLE_TIME[NEXUIZ_TEST[0]] = 10
92    TEST_COMMAND_SETTLE_TIME[XONOTIC_TEST[0]] = 20
93    GAMES_TESTS = [NEXUIZ_TEST, XONOTIC_TEST]
94
95    VLC_VIDEO_TEST = (VLC_BIN, "-L", "./test.avi")
96    MPLAYER_VIDEO_TEST = "while true; do %s test.avi; done" % MPLAYER_BIN
97
98    #sound tests
99    VIDEO_TESTS = []
100    SOUND_TESTS = []
101    MPLAYER_SOUND_LOOP_TEST = "while true; do %s ./test.mp3; done" % MPLAYER_BIN
102    VLC_SOUND_TEST = (VLC_BIN, "-L", "--audio-visual=visual", "./test.mp3")
103    if not os.path.exists("test.mp3"):
104        print("test.mp3 not found, the corresponding sound mplayer sound and vlc video tests are disabled")
105    else:
106        SOUND_TESTS.append(MPLAYER_SOUND_LOOP_TEST)
107        VIDEO_TESTS.append(VLC_SOUND_TEST)
108
109    #video tests
110    if not os.path.exists("test.avi"):
111        print("test.avi not found, vlc and mplayer video tests are disabled")
112    else:
113        VIDEO_TESTS.append(VLC_VIDEO_TEST)
114        VIDEO_TESTS.append(MPLAYER_VIDEO_TEST)
115
116    XPRA_FORCE_XDUMMY = False
117
118    #XPRA_QUALITY_OPTIONS = [40, 90]
119    #XPRA_QUALITY_OPTIONS = [80]
120    XPRA_QUALITY_OPTIONS = [10, 40, 80, 90]
121
122    #XPRA_COMPRESSORS_OPTIONS = ["lz4", "zlib", "lzo", "zlib,lzo", "all", "none"]
123    XPRA_COMPRESSORS_OPTIONS = ["all"]
124
125    #XPRA_COMPRESSION_LEVEL_OPTIONS = [0, 3, 9]
126    #XPRA_COMPRESSION_LEVEL_OPTIONS = [0, 3]
127    XPRA_COMPRESSION_LEVEL_OPTIONS = [None]
128
129    #XPRA_PACKET_ENCODERS_OPTIONS = ["rencode", "bencode", "yaml"]
130    XPRA_PACKET_ENCODERS_OPTIONS = ["rencode"]
131
132    #XPRA_CONNECT_OPTIONS = [("ssh", None), ("tcp", None), ("unix", None)]
133    XPRA_CONNECT_OPTIONS = [("tcp", None)]
134    #if XPRA_VERSION_NO>=[0, 7]:
135    #    XPRA_CONNECT_OPTIONS.append(("tcp", "AES"))
136
137    #XPRA_TEST_ENCODINGS = ["png", "x264", "mmap"]
138    #XPRA_TEST_ENCODINGS = ["png", "jpeg", "x264", "vpx", "mmap"]
139    XPRA_TEST_ENCODINGS = ["png", "rgb24", "jpeg", "x264", "vpx", "mmap"]
140
141    #XPRA_ENCODING_QUALITY_OPTIONS = {"jpeg" : XPRA_QUALITY_OPTIONS,
142    #    "webp" : XPRA_QUALITY_OPTIONS,
143    #    "x264" : XPRA_QUALITY_OPTIONS+[-1]}
144    XPRA_ENCODING_QUALITY_OPTIONS = {"jpeg" : [-1],
145        "x264" : [-1]}
146    XPRA_ENCODING_SPEED_OPTIONS = {"rgb24" : [-1, 0, 100]}
147
148    #XPRA_OPENGL_OPTIONS = {"x264" : [True, False],
149    #    "vpx" : [True, False]}
150    #only test default opengl setting:
151    XPRA_OPENGL_OPTIONS = {}
152
153    XPRA_MDNS = False
154
155    TEST_SOUND = False
156
157    def test_vars(self):
158        for x in self.CUSTOM_PARAMS:
159            print("CUSTOM_PARAM %s" % x)
160        print("IP %s" % self.IP)
161        print("PORT %s" % self.PORT)
162        print("DISPLAY_NO %s" % self.DISPLAY_NO)
163        print("START_SERVER %s" % self.START_SERVER)
164        print("SETTLE_TIME %s" % self.SETTLE_TIME)
165        print("MEASURE_TIME %s" % self.MEASURE_TIME)
166        print("COLLECT_STATS_TIME %s" % self.COLLECT_STATS_TIME)
167        print("SERVER_SETTLE_TIME %s" % self.SERVER_SETTLE_TIME)
168        print("DEFAULT_TEST_COMMAND_SETTLE_TIME %s" % self.DEFAULT_TEST_COMMAND_SETTLE_TIME)
169        print("TEST_XPRA %s" % self.TEST_XPRA)
170        print("TEST_VNC %s" % self.TEST_VNC)
171        print("USE_IPTABLES %s" % self.USE_IPTABLES)
172        print("USE_VIRTUALGL %s" % self.USE_VIRTUALGL)
173        print("PREVENT_SLEEP %s" % self.PREVENT_SLEEP)
174        print("LIMIT_TESTS %s" % self.LIMIT_TESTS)
175        print("MAX_ERRORS %s" % self.MAX_ERRORS)
176        print("TRICKLE_SHAPPING_OPTIONS %s" % self.TRICKLE_SHAPING_OPTIONS)
177        print("GLX_TESTS %s" % self.GLX_TESTS)
178        print("X11_TESTS %s" % self.X11_TESTS)
179        print("XPRA_USE_PASSWORD %s" % self.XPRA_USE_PASSWORD)
180        print("TEST_COMMAND_SETTLE_TIME %s" % self.TEST_COMMAND_SETTLE_TIME)
181        print("GAMES_TEST %s" % self.GAMES_TESTS)
182        print("SOUND_TESTS %s" % self.SOUND_TESTS)
183        print("VIDEO_TESTS %s" % self.VIDEO_TESTS)
184
185
186
187
188