2 @message |
Performance problem
assert
- CPU time ratio when sending COMPRESSABLE TEXTUAL DATA and WireCompression is ON vs OFF: EXPECTED
+ CPU time ratio when sending COMPRESSABLE TEXTUAL DATA and WireCompression is ON vs OFF: /* perf_issue_tag */ UNEXPECTED less than 5
- CPU time ratio when sending INCOMPRESSABLE BINARY DATA and WireCompression is ON vs OFF: EXPECTED
+ CPU time ratio when sending INCOMPRESSABLE BINARY DATA and WireCompression is ON vs OFF: /* perf_issue_tag */ UNEXPECTED, less than 4
CPU time ratio when WireCompression is OFF and sending TEXTUAL vs BINARY data: EXPECTED
+ compressed_txt= [0.61, 0.8, 0.7799999999999999, 0.77, 0.6599999999999999, 0.62, 0.7, 0.6799999999999999, 0.74] min= 0.61 max= 0.8
+ compressed_bin= [0.65, 0.82, 0.7000000000000001, 0.81, 0.76, 0.7599999999999999, 0.8400000000000001, 0.79, 0.84] min= 0.65 max= 0.8400000000000001
+ non_comprs_txt= [0.19999999999999998, 0.18, 0.22000000000000003, 0.2, 0.15, 0.19999999999999998, 0.18, 0.18, 0.15000000000000002] min= 0.15 max= 0.22000000000000003
+ non_comprs_bin= [0.26, 0.28, 0.21999999999999997, 0.22999999999999998, 0.26, 0.28, 0.22999999999999998, 0.30000000000000004, 0.27] min= 0.21999999999999997 max= 0.30000000000000004
+ median(compressed_txt) / median(non_comprs_txt) = 3.888888888888889
+ median(compressed_bin) / median(non_comprs_bin) = 3.0384615384615383
+ median(non_comprs_txt) / median(non_comprs_bin) = 0.6923076923076923
LOG DETAILS:
2025-03-27 14:21:58.232
2025-03-27 14:21:58.238 act = <firebird.qa.plugin.Action object at [hex]>
2025-03-27 14:21:58.246 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-03-27 14:21:58.253
2025-03-27 14:21:58.260 @pytest.mark.version('>=3.0')
2025-03-27 14:21:58.267 def test_1(act: Action, capsys):
2025-03-27 14:21:58.274
2025-03-27 14:21:58.282 # OPTIONAL CHECK: minimal ratio between CPU user time when WireCompression = false
2025-03-27 14:21:58.289 # and engine sends to client: 1) 'IDEALLY COMPRESSABLE'; 2) 'ABSOLUTELY IMCOMPRESSIBLE' data.
2025-03-27 14:21:58.296 # This can be useful to estimate record-level compression: textual data can be compressed
2025-03-27 14:21:58.303 # very well, so its transfer must take much less time then for GEN_UUID.
2025-03-27 14:21:58.311 # Experiments show that this ratio can be on Windows in the scope 0.3.... 0.8,
2025-03-27 14:21:58.325 # but on Linux it can be 1.0 or even slightly more then 1(!)
2025-03-27 14:21:58.333 # Windows: 0.500; 0.600; 0.571; 0.428; 0.714; 0.667; 0.625; 0.429; 0.571 // 4.0.1
2025-03-27 14:21:58.339 # 0.454; 0.357; 0.357; 0.500; 0.250; 0.385; 0.333; 0.200; 0.500 // 3.0.8
2025-03-27 14:21:58.346 # Linux: 0.684; 1.000; 1.000; 1.067; 0.867; 0.813; 0.800; 0.777; 0.750 // 4.0.1
2025-03-27 14:21:58.354 # 0.928; 1.000; 0.933; 1.000; 1.077; 0.750; 0.938; 0.929; 0.928 // 3.0.8
2025-03-27 14:21:58.362 if act.is_version('<4'):
2025-03-27 14:21:58.371 # 16.09.2022, 4.3.0.8 Classic: Windows -> 1.2
2025-03-27 14:21:58.378 MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF = 1.1 if platform.system() == 'Linux' else 1.5
2025-03-27 14:21:58.385 else:
2025-03-27 14:21:58.391 # 05.03.2023, 5.0.0.970, SS, Linux: 1.1 --> 1.3
2025-03-27 14:21:58.398 # 05.04.2023, 5.0.0.1001, SS, WIndows: 0.95 --> 1.5
2025-03-27 14:21:58.405 MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF = 1.3 if platform.system() == 'Linux' else 1.5
2025-03-27 14:21:58.411
2025-03-27 14:21:58.418 # Register Firebird server (D:\FB\probes\fid-set-dpb-probe-05x.py)
2025-03-27 14:21:58.428 srv_cfg = driver_config.register_server(name = 'test_srv_core_0733', config = '')
2025-03-27 14:21:58.441
2025-03-27 14:21:58.454 #srv_config_key_value_text = \
2025-03-27 14:21:58.464 #f"""
2025-03-27 14:21:58.472 # [test_srv_core_0733]
2025-03-27 14:21:58.479 # protocol = inet
2025-03-27 14:21:58.486 #"""
2025-03-27 14:21:58.493 #driver_config.register_server(name = 'test_srv_core_0733', config = srv_config_key_value_text)
2025-03-27 14:21:58.500 #db_cfg_object = driver_config.register_database(name = 'test_db_core_0733')
2025-03-27 14:21:58.506 #db_cfg_object.database.value = str(act.db.db_path)
2025-03-27 14:21:58.513
2025-03-27 14:21:58.520 benchmark_data = defaultdict(list)
2025-03-27 14:21:58.527
2025-03-27 14:21:58.535 for w_compr in (True, False):
2025-03-27 14:21:58.542
2025-03-27 14:21:58.549 db_cfg_name = f'test_db_core_0733__wcompr_{w_compr}'
2025-03-27 14:21:58.555 db_cfg_object = driver_config.register_database(name = db_cfg_name)
2025-03-27 14:21:58.562 db_cfg_object.server.value = srv_cfg.name
2025-03-27 14:21:58.569 # db_cfg_object.protocol.value = None / XNET / WNET -- these can not be used in this test!
2025-03-27 14:21:58.576 db_cfg_object.protocol.value = NetProtocol.INET
2025-03-27 14:21:58.584 db_cfg_object.database.value = str(act.db.db_path)
2025-03-27 14:21:58.591 db_cfg_object.config.value = f"""
2025-03-27 14:21:58.598 WireCrypt = Disabled
2025-03-27 14:21:58.606 WireCompression = {w_compr}
2025-03-27 14:21:58.614 """
2025-03-27 14:21:58.620 for i in range(0, N_MEASURES):
2025-03-27 14:21:58.626 with connect(db_cfg_name, user = act.db.user, password = act.db.password) as con:
2025-03-27 14:21:58.635 prot_name = db_cfg_object.protocol.value.name if db_cfg_object.protocol.value else 'Embedded'
2025-03-27 14:21:58.643 assert w_compr == con.info.is_compressed(), f'Protocol: {prot_name} - can not be used to measure wire_compression'
2025-03-27 14:21:58.648
2025-03-27 14:21:58.654 with con.cursor() as cur:
2025-03-27 14:21:58.661 cur.execute('select mon$server_pid, mon$remote_protocol as p from mon$attachments where mon$attachment_id = current_connection')
2025-03-27 14:21:58.667 for r in cur:
2025-03-27 14:21:58.674 fb_pid, connection_protocol = r
2025-03-27 14:21:58.681 assert connection_protocol.startswith('TCP'), f'Invalid connection protocol: {connection_protocol}'
2025-03-27 14:21:58.687
2025-03-27 14:21:58.694 for data_source in ('t_common_text', 't_binary_data'):
2025-03-27 14:21:58.701 cur.execute('select s from ' + data_source)
2025-03-27 14:21:58.708
2025-03-27 14:21:58.715 fb_info_a = psutil.Process(fb_pid).cpu_times()
2025-03-27 14:21:58.722 for r in cur:
2025-03-27 14:21:58.729 # *** FULL FETCH ***
2025-03-27 14:21:58.736 pass
2025-03-27 14:21:58.744 fb_info_b = psutil.Process(fb_pid).cpu_times()
2025-03-27 14:21:58.752
2025-03-27 14:21:58.761 k = ('WireCompression=%d' % (1 if w_compr else 0), 'DataSource='+data_source)
2025-03-27 14:21:58.769 benchmark_data[k] += fb_info_b.user - fb_info_a.user,
2025-03-27 14:21:58.777
2025-03-27 14:21:58.785
2025-03-27 14:21:58.794 compressed_txt = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=1' and k[1] == 'DataSource=t_common_text'][0]
2025-03-27 14:21:58.802 compressed_bin = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=1' and k[1] == 'DataSource=t_binary_data'][0]
2025-03-27 14:21:58.811 non_comprs_txt = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=0' and k[1] == 'DataSource=t_common_text'][0]
2025-03-27 14:21:58.821 non_comprs_bin = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=0' and k[1] == 'DataSource=t_binary_data'][0]
2025-03-27 14:21:58.827
2025-03-27 14:21:58.842 cpu_txt_wcompr_ON_vs_OFF = median(compressed_txt) / max(0.00001, median(non_comprs_txt))
2025-03-27 14:21:58.851 cpu_bin_wcompr_ON_vs_OFF = median(compressed_bin) / max(0.00001, median(non_comprs_bin))
2025-03-27 14:21:58.858 cpu_txt2bin_wcompr_OFF = median(non_comprs_txt) / max(0.00001, median(non_comprs_bin))
2025-03-27 14:21:58.865
2025-03-27 14:21:58.871 msg_result1 = 'CPU time ratio when sending %s and WireCompression is ON vs OFF: %s'
2025-03-27 14:21:58.878 what_sent1 = 'COMPRESSABLE TEXTUAL DATA'
2025-03-27 14:21:58.883 all_fine = 1
2025-03-27 14:21:58.890 if cpu_txt_wcompr_ON_vs_OFF > MIN_CPU_RATIO_TXT_WCOMPR_ON_OFF:
2025-03-27 14:21:58.898 print(msg_result1 % (what_sent1, 'EXPECTED') )
2025-03-27 14:21:58.905 else:
2025-03-27 14:21:58.912 print(msg_result1 % (what_sent1, '/* perf_issue_tag */ UNEXPECTED less than '+str(MIN_CPU_RATIO_TXT_WCOMPR_ON_OFF)) )
2025-03-27 14:21:58.918 all_fine = 0
2025-03-27 14:21:58.924
2025-03-27 14:21:58.931
2025-03-27 14:21:58.937 what_sent2 = 'INCOMPRESSABLE BINARY DATA'
2025-03-27 14:21:58.943 if cpu_bin_wcompr_ON_vs_OFF > MIN_CPU_RATIO_BIN_WCOMPR_ON_OFF:
2025-03-27 14:21:58.950 print(msg_result1 % (what_sent2, 'EXPECTED') )
2025-03-27 14:21:58.957 else:
2025-03-27 14:21:58.963 print(msg_result1 % (what_sent2, '/* perf_issue_tag */ UNEXPECTED, less than '+str(MIN_CPU_RATIO_BIN_WCOMPR_ON_OFF)) )
2025-03-27 14:21:58.969 all_fine = 0
2025-03-27 14:21:58.976
2025-03-27 14:21:58.982
2025-03-27 14:21:58.989 msg_result2 = 'CPU time ratio when WireCompression is OFF and sending TEXTUAL vs BINARY data: %s'
2025-03-27 14:21:58.997 if cpu_txt2bin_wcompr_OFF <= MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF:
2025-03-27 14:21:59.004 print(msg_result2 % ('EXPECTED') )
2025-03-27 14:21:59.010 else:
2025-03-27 14:21:59.017 print(msg_result2 % ('/* perf_issue_tag */ UNEXPECTED, more than ' + str(MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF)) )
2025-03-27 14:21:59.024 all_fine = 0
2025-03-27 14:21:59.033
2025-03-27 14:21:59.043 if not all_fine:
2025-03-27 14:21:59.050 print('compressed_txt=',compressed_txt,' min=',min(compressed_txt),' max=',max(compressed_txt))
2025-03-27 14:21:59.063 print('compressed_bin=',compressed_bin,' min=',min(compressed_bin),' max=',max(compressed_bin))
2025-03-27 14:21:59.072 print('non_comprs_txt=',non_comprs_txt,' min=',min(non_comprs_txt),' max=',max(non_comprs_txt))
2025-03-27 14:21:59.078 print('non_comprs_bin=',non_comprs_bin,' min=',min(non_comprs_bin),' max=',max(non_comprs_bin))
2025-03-27 14:21:59.083
2025-03-27 14:21:59.089 print('median(compressed_txt) / median(non_comprs_txt) =',1.000 * median(compressed_txt) / max(0.00001, median(non_comprs_txt)) )
2025-03-27 14:21:59.094 print('median(compressed_bin) / median(non_comprs_bin) =',1.000 * median(compressed_bin) / max(0.00001, median(non_comprs_bin)) )
2025-03-27 14:21:59.100 print('median(non_comprs_txt) / median(non_comprs_bin) =',1.000 * median(non_comprs_txt) / max(0.00001, median(non_comprs_bin)) )
2025-03-27 14:21:59.105
2025-03-27 14:21:59.110
2025-03-27 14:21:59.115 expected_stdout = ''
2025-03-27 14:21:59.121 for f in (what_sent1, what_sent2):
2025-03-27 14:21:59.126 expected_stdout += ''.join( (msg_result1 % (f, 'EXPECTED'), '\n') )
2025-03-27 14:21:59.131 expected_stdout += (msg_result2 % 'EXPECTED')
2025-03-27 14:21:59.136
2025-03-27 14:21:59.141 act.expected_stdout = expected_stdout
2025-03-27 14:21:59.154 act.stdout = capsys.readouterr().out
2025-03-27 14:21:59.162 > assert act.clean_stdout == act.clean_expected_stdout
2025-03-27 14:21:59.169 E assert
2025-03-27 14:21:59.177 E - CPU time ratio when sending COMPRESSABLE TEXTUAL DATA and WireCompression is ON vs OFF: EXPECTED
2025-03-27 14:21:59.184 E + CPU time ratio when sending COMPRESSABLE TEXTUAL DATA and WireCompression is ON vs OFF: /* perf_issue_tag */ UNEXPECTED less than 5
2025-03-27 14:21:59.210 E - CPU time ratio when sending INCOMPRESSABLE BINARY DATA and WireCompression is ON vs OFF: EXPECTED
2025-03-27 14:21:59.222 E + CPU time ratio when sending INCOMPRESSABLE BINARY DATA and WireCompression is ON vs OFF: /* perf_issue_tag */ UNEXPECTED, less than 4
2025-03-27 14:21:59.239 E CPU time ratio when WireCompression is OFF and sending TEXTUAL vs BINARY data: EXPECTED
2025-03-27 14:21:59.247 E + compressed_txt= [0.61, 0.8, 0.7799999999999999, 0.77, 0.6599999999999999, 0.62, 0.7, 0.6799999999999999, 0.74] min= 0.61 max= 0.8
2025-03-27 14:21:59.254 E + compressed_bin= [0.65, 0.82, 0.7000000000000001, 0.81, 0.76, 0.7599999999999999, 0.8400000000000001, 0.79, 0.84] min= 0.65 max= 0.8400000000000001
2025-03-27 14:21:59.261 E + non_comprs_txt= [0.19999999999999998, 0.18, 0.22000000000000003, 0.2, 0.15, 0.19999999999999998, 0.18, 0.18, 0.15000000000000002] min= 0.15 max= 0.22000000000000003
2025-03-27 14:21:59.269 E + non_comprs_bin= [0.26, 0.28, 0.21999999999999997, 0.22999999999999998, 0.26, 0.28, 0.22999999999999998, 0.30000000000000004, 0.27] min= 0.21999999999999997 max= 0.30000000000000004
2025-03-27 14:21:59.276 E + median(compressed_txt) / median(non_comprs_txt) = 3.888888888888889
2025-03-27 14:21:59.283 E + median(compressed_bin) / median(non_comprs_bin) = 3.0384615384615383
2025-03-27 14:21:59.292 E + median(non_comprs_txt) / median(non_comprs_bin) = 0.6923076923076923
2025-03-27 14:21:59.301
2025-03-27 14:21:59.307 tests/bugs/core_0733_test.py:254: AssertionError
2025-03-27 14:21:59.313 ---------------------------- Captured stdout setup -----------------------------
2025-03-27 14:21:59.319 Creating db: localhost:/var/tmp/qa_2024/test_173/test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
2025-03-27 14:21:59.325 ____________________ tests/bugs/core_1263_test.py::test_1_a ____________________
2025-03-27 14:21:59.330
2025-03-27 14:21:59.339 act = <firebird.qa.plugin.Action object at [hex]>
2025-03-27 14:21:59.349
2025-03-27 14:21:59.357 @pytest.mark.version('>=3.0')
2025-03-27 14:21:59.363 @pytest.mark.platform('Linux', 'Darwin')
2025-03-27 14:21:59.369 def test_1_a(act: Action):
2025-03-27 14:21:59.375 act.expected_stderr = expected_stderr_a
2025-03-27 14:21:59.381 act.gsec(input=commands)
2025-03-27 14:21:59.388 > assert act.clean_stderr == act.clean_expected_stderr
2025-03-27 14:21:59.393 E assert
2025-03-27 14:21:59.399 E GSEC> invalid switch specified in interactive mode
2025-03-27 14:21:59.404 E GSEC> invalid switch specified in interactive mode
2025-03-27 14:21:59.411 E GSEC> invalid switch specified in interactive mode
2025-03-27 14:21:59.416 E GSEC> invalid switch specified in interactive mode
2025-03-27 14:21:59.422 E GSEC> invalid switch specified in interactive mode
2025-03-27 14:21:59.428 E - GSEC> invalid switch specified
2025-03-27 14:21:59.434 E + GSEC> invalid switch specified in interactive mode
2025-03-27 14:21:59.445 E - error in switch specifications
2025-03-27 14:21:59.451 E GSEC>
2025-03-27 14:21:59.460
2025-03-27 14:21:59.468 tests/bugs/core_1263_test.py:44: AssertionError
2025-03-27 14:21:59.477 ---------------------------- Captured stdout setup -----------------------------
2025-03-27 14:21:59.485 Creating db: localhost:/var/tmp/qa_2024/test_1_a0/test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=3.0')
def test_1(act: Action, capsys):
# OPTIONAL CHECK: minimal ratio between CPU user time when WireCompression = false
# and engine sends to client: 1) 'IDEALLY COMPRESSABLE'; 2) 'ABSOLUTELY IMCOMPRESSIBLE' data.
# This can be useful to estimate record-level compression: textual data can be compressed
# very well, so its transfer must take much less time then for GEN_UUID.
# Experiments show that this ratio can be on Windows in the scope 0.3.... 0.8,
# but on Linux it can be 1.0 or even slightly more then 1(!)
# Windows: 0.500; 0.600; 0.571; 0.428; 0.714; 0.667; 0.625; 0.429; 0.571 // 4.0.1
# 0.454; 0.357; 0.357; 0.500; 0.250; 0.385; 0.333; 0.200; 0.500 // 3.0.8
# Linux: 0.684; 1.000; 1.000; 1.067; 0.867; 0.813; 0.800; 0.777; 0.750 // 4.0.1
# 0.928; 1.000; 0.933; 1.000; 1.077; 0.750; 0.938; 0.929; 0.928 // 3.0.8
if act.is_version('<4'):
# 16.09.2022, 4.3.0.8 Classic: Windows -> 1.2
MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF = 1.1 if platform.system() == 'Linux' else 1.5
else:
# 05.03.2023, 5.0.0.970, SS, Linux: 1.1 --> 1.3
# 05.04.2023, 5.0.0.1001, SS, WIndows: 0.95 --> 1.5
MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF = 1.3 if platform.system() == 'Linux' else 1.5
# Register Firebird server (D:\FB\probes\fid-set-dpb-probe-05x.py)
srv_cfg = driver_config.register_server(name = 'test_srv_core_0733', config = '')
#srv_config_key_value_text = \
#f"""
# [test_srv_core_0733]
# protocol = inet
#"""
#driver_config.register_server(name = 'test_srv_core_0733', config = srv_config_key_value_text)
#db_cfg_object = driver_config.register_database(name = 'test_db_core_0733')
#db_cfg_object.database.value = str(act.db.db_path)
benchmark_data = defaultdict(list)
for w_compr in (True, False):
db_cfg_name = f'test_db_core_0733__wcompr_{w_compr}'
db_cfg_object = driver_config.register_database(name = db_cfg_name)
db_cfg_object.server.value = srv_cfg.name
# db_cfg_object.protocol.value = None / XNET / WNET -- these can not be used in this test!
db_cfg_object.protocol.value = NetProtocol.INET
db_cfg_object.database.value = str(act.db.db_path)
db_cfg_object.config.value = f"""
WireCrypt = Disabled
WireCompression = {w_compr}
"""
for i in range(0, N_MEASURES):
with connect(db_cfg_name, user = act.db.user, password = act.db.password) as con:
prot_name = db_cfg_object.protocol.value.name if db_cfg_object.protocol.value else 'Embedded'
assert w_compr == con.info.is_compressed(), f'Protocol: {prot_name} - can not be used to measure wire_compression'
with con.cursor() as cur:
cur.execute('select mon$server_pid, mon$remote_protocol as p from mon$attachments where mon$attachment_id = current_connection')
for r in cur:
fb_pid, connection_protocol = r
assert connection_protocol.startswith('TCP'), f'Invalid connection protocol: {connection_protocol}'
for data_source in ('t_common_text', 't_binary_data'):
cur.execute('select s from ' + data_source)
fb_info_a = psutil.Process(fb_pid).cpu_times()
for r in cur:
# *** FULL FETCH ***
pass
fb_info_b = psutil.Process(fb_pid).cpu_times()
k = ('WireCompression=%d' % (1 if w_compr else 0), 'DataSource='+data_source)
benchmark_data[k] += fb_info_b.user - fb_info_a.user,
compressed_txt = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=1' and k[1] == 'DataSource=t_common_text'][0]
compressed_bin = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=1' and k[1] == 'DataSource=t_binary_data'][0]
non_comprs_txt = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=0' and k[1] == 'DataSource=t_common_text'][0]
non_comprs_bin = [ v for k,v in benchmark_data.items() if k[0] == 'WireCompression=0' and k[1] == 'DataSource=t_binary_data'][0]
cpu_txt_wcompr_ON_vs_OFF = median(compressed_txt) / max(0.00001, median(non_comprs_txt))
cpu_bin_wcompr_ON_vs_OFF = median(compressed_bin) / max(0.00001, median(non_comprs_bin))
cpu_txt2bin_wcompr_OFF = median(non_comprs_txt) / max(0.00001, median(non_comprs_bin))
msg_result1 = 'CPU time ratio when sending %s and WireCompression is ON vs OFF: %s'
what_sent1 = 'COMPRESSABLE TEXTUAL DATA'
all_fine = 1
if cpu_txt_wcompr_ON_vs_OFF > MIN_CPU_RATIO_TXT_WCOMPR_ON_OFF:
print(msg_result1 % (what_sent1, 'EXPECTED') )
else:
print(msg_result1 % (what_sent1, '/* perf_issue_tag */ UNEXPECTED less than '+str(MIN_CPU_RATIO_TXT_WCOMPR_ON_OFF)) )
all_fine = 0
what_sent2 = 'INCOMPRESSABLE BINARY DATA'
if cpu_bin_wcompr_ON_vs_OFF > MIN_CPU_RATIO_BIN_WCOMPR_ON_OFF:
print(msg_result1 % (what_sent2, 'EXPECTED') )
else:
print(msg_result1 % (what_sent2, '/* perf_issue_tag */ UNEXPECTED, less than '+str(MIN_CPU_RATIO_BIN_WCOMPR_ON_OFF)) )
all_fine = 0
msg_result2 = 'CPU time ratio when WireCompression is OFF and sending TEXTUAL vs BINARY data: %s'
if cpu_txt2bin_wcompr_OFF <= MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF:
print(msg_result2 % ('EXPECTED') )
else:
print(msg_result2 % ('/* perf_issue_tag */ UNEXPECTED, more than ' + str(MAX_CPU_RATIO_TXT2BIN_WCOMPR_OFF)) )
all_fine = 0
if not all_fine:
print('compressed_txt=',compressed_txt,' min=',min(compressed_txt),' max=',max(compressed_txt))
print('compressed_bin=',compressed_bin,' min=',min(compressed_bin),' max=',max(compressed_bin))
print('non_comprs_txt=',non_comprs_txt,' min=',min(non_comprs_txt),' max=',max(non_comprs_txt))
print('non_comprs_bin=',non_comprs_bin,' min=',min(non_comprs_bin),' max=',max(non_comprs_bin))
print('median(compressed_txt) / median(non_comprs_txt) =',1.000 * median(compressed_txt) / max(0.00001, median(non_comprs_txt)) )
print('median(compressed_bin) / median(non_comprs_bin) =',1.000 * median(compressed_bin) / max(0.00001, median(non_comprs_bin)) )
print('median(non_comprs_txt) / median(non_comprs_bin) =',1.000 * median(non_comprs_txt) / max(0.00001, median(non_comprs_bin)) )
expected_stdout = ''
for f in (what_sent1, what_sent2):
expected_stdout += ''.join( (msg_result1 % (f, 'EXPECTED'), '\n') )
expected_stdout += (msg_result2 % 'EXPECTED')
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E - CPU time ratio when sending COMPRESSABLE TEXTUAL DATA and WireCompression is ON vs OFF: EXPECTED
E + CPU time ratio when sending COMPRESSABLE TEXTUAL DATA and WireCompression is ON vs OFF: /* perf_issue_tag */ UNEXPECTED less than 5
E - CPU time ratio when sending INCOMPRESSABLE BINARY DATA and WireCompression is ON vs OFF: EXPECTED
E + CPU time ratio when sending INCOMPRESSABLE BINARY DATA and WireCompression is ON vs OFF: /* perf_issue_tag */ UNEXPECTED, less than 4
E CPU time ratio when WireCompression is OFF and sending TEXTUAL vs BINARY data: EXPECTED
E + compressed_txt= [0.61, 0.8, 0.7799999999999999, 0.77, 0.6599999999999999, 0.62, 0.7, 0.6799999999999999, 0.74] min= 0.61 max= 0.8
E + compressed_bin= [0.65, 0.82, 0.7000000000000001, 0.81, 0.76, 0.7599999999999999, 0.8400000000000001, 0.79, 0.84] min= 0.65 max= 0.8400000000000001
E + non_comprs_txt= [0.19999999999999998, 0.18, 0.22000000000000003, 0.2, 0.15, 0.19999999999999998, 0.18, 0.18, 0.15000000000000002] min= 0.15 max= 0.22000000000000003
E + non_comprs_bin= [0.26, 0.28, 0.21999999999999997, 0.22999999999999998, 0.26, 0.28, 0.22999999999999998, 0.30000000000000004, 0.27] min= 0.21999999999999997 max= 0.30000000000000004
E + median(compressed_txt) / median(non_comprs_txt) = 3.888888888888889
E + median(compressed_bin) / median(non_comprs_bin) = 3.0384615384615383
E + median(non_comprs_txt) / median(non_comprs_bin) = 0.6923076923076923
tests/bugs/core_0733_test.py:254: AssertionError
|