2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.63889, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.37
+ 0.3700000000000001
+ 0.3700000000000001
+ 0.3699999999999992
+ 0.33999999999999986
+ 0.3600000000000012
+ 0.34999999999999964
+ 0.3699999999999992
+ 0.3500000000000014
+ 0.38000000000000256
+ 0.35999999999999943
+ 0.370000000000001
+ 0.35999999999999943
+ 0.3500000000000014
+ 0.36999999999999744
+ 0.35999999999999943
+ 0.35999999999999943
+ 0.3399999999999963
+ 0.4399999999999977
+ 0.3500000000000014
+ 0.37999999999999545
+ sp_name='udr_call':
+ 1.66
+ 1.6599999999999997
+ 1.6800000000000006
+ 1.6799999999999997
+ 1.6500000000000004
+ 1.8599999999999994
+ 1.6500000000000004
+ 1.6899999999999995
+ 1.7199999999999989
+ 1.6099999999999994
+ 1.6899999999999977
+ 1.620000000000001
+ 1.6400000000000006
+ 1.8399999999999999
+ 1.6600000000000001
+ 1.740000000000002
+ 1.7100000000000009
+ 1.6700000000000017
+ 1.6700000000000017
+ 1.6600000000000037
+ 1.7000000000000028
LOG DETAILS:
2025-06-16 05:30:10.668
2025-06-16 05:30:10.674 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-16 05:30:10.681 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-16 05:30:10.686
2025-06-16 05:30:10.692 @pytest.mark.version('>=6.0')
2025-06-16 05:30:10.698 def test_1(act: Action, capsys):
2025-06-16 05:30:10.708
2025-06-16 05:30:10.718 with act.db.connect() as con:
2025-06-16 05:30:10.726 cur=con.cursor()
2025-06-16 05:30:10.732 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-16 05:30:10.739 fb_pid = int(cur.fetchone()[0])
2025-06-16 05:30:10.745
2025-06-16 05:30:10.750 times_map = {}
2025-06-16 05:30:10.756 for i in range(0, N_MEASURES):
2025-06-16 05:30:10.767 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-16 05:30:10.777 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-16 05:30:10.785 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-16 05:30:10.792 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-16 05:30:10.798
2025-06-16 05:30:10.805 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-16 05:30:10.811 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-16 05:30:10.818 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-16 05:30:10.824 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-16 05:30:10.830
2025-06-16 05:30:10.837
2025-06-16 05:30:10.843 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-16 05:30:10.853 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-16 05:30:10.866
2025-06-16 05:30:10.876 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-16 05:30:10.888
2025-06-16 05:30:10.898 print( 'Medians ratio: ' + ('acceptable' if median_ratio <= MAX_RATIO else '/* perf_issue_tag */ POOR: %s, more than threshold: %s' % ( '{:9g}'.format(median_ratio), '{:9g}'.format(MAX_RATIO) ) ) )
2025-06-16 05:30:10.907 if median_ratio > MAX_RATIO:
2025-06-16 05:30:10.918 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-16 05:30:10.927 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-16 05:30:10.934 print(f'{sp_name=}:')
2025-06-16 05:30:10.943 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-16 05:30:10.954 print(p)
2025-06-16 05:30:10.963
2025-06-16 05:30:10.969 act.expected_stdout = expected_stdout
2025-06-16 05:30:10.976 act.stdout = capsys.readouterr().out
2025-06-16 05:30:10.983 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-16 05:30:10.991 E AssertionError: assert
2025-06-16 05:30:11.004 E - Medians ratio: acceptable
2025-06-16 05:30:11.015 E + Medians ratio: /* perf_issue_tag */ POOR: 4.63889, more than threshold: 0.4
2025-06-16 05:30:11.022 E + CPU times for each of 21 measures:
2025-06-16 05:30:11.028 E + sp_name='hash_eval':
2025-06-16 05:30:11.034 E + 0.37
2025-06-16 05:30:11.043 E + 0.3700000000000001
2025-06-16 05:30:11.051 E + 0.3700000000000001
2025-06-16 05:30:11.064 E + 0.3699999999999992
2025-06-16 05:30:11.072 E + 0.33999999999999986
2025-06-16 05:30:11.079 E + 0.3600000000000012
2025-06-16 05:30:11.086 E + 0.34999999999999964
2025-06-16 05:30:11.096 E + 0.3699999999999992
2025-06-16 05:30:11.107 E + 0.3500000000000014
2025-06-16 05:30:11.117 E + 0.38000000000000256
2025-06-16 05:30:11.126 E + 0.35999999999999943
2025-06-16 05:30:11.137 E + 0.370000000000001
2025-06-16 05:30:11.147 E + 0.35999999999999943
2025-06-16 05:30:11.155 E + 0.3500000000000014
2025-06-16 05:30:11.165 E + 0.36999999999999744
2025-06-16 05:30:11.179 E + 0.35999999999999943
2025-06-16 05:30:11.186 E + 0.35999999999999943
2025-06-16 05:30:11.193 E + 0.3399999999999963
2025-06-16 05:30:11.200 E + 0.4399999999999977
2025-06-16 05:30:11.207 E + 0.3500000000000014
2025-06-16 05:30:11.214 E + 0.37999999999999545
2025-06-16 05:30:11.219 E + sp_name='udr_call':
2025-06-16 05:30:11.223 E + 1.66
2025-06-16 05:30:11.228 E + 1.6599999999999997
2025-06-16 05:30:11.232 E + 1.6800000000000006
2025-06-16 05:30:11.237 E + 1.6799999999999997
2025-06-16 05:30:11.243 E + 1.6500000000000004
2025-06-16 05:30:11.250 E + 1.8599999999999994
2025-06-16 05:30:11.256 E + 1.6500000000000004
2025-06-16 05:30:11.261 E + 1.6899999999999995
2025-06-16 05:30:11.267 E + 1.7199999999999989
2025-06-16 05:30:11.276 E + 1.6099999999999994
2025-06-16 05:30:11.284 E + 1.6899999999999977
2025-06-16 05:30:11.290 E + 1.620000000000001
2025-06-16 05:30:11.296 E + 1.6400000000000006
2025-06-16 05:30:11.303 E + 1.8399999999999999
2025-06-16 05:30:11.310 E + 1.6600000000000001
2025-06-16 05:30:11.316 E + 1.740000000000002
2025-06-16 05:30:11.323 E + 1.7100000000000009
2025-06-16 05:30:11.329 E + 1.6700000000000017
2025-06-16 05:30:11.336 E + 1.6700000000000017
2025-06-16 05:30:11.343 E + 1.6600000000000037
2025-06-16 05:30:11.350 E + 1.7000000000000028
2025-06-16 05:30:11.356
2025-06-16 05:30:11.363 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-16 05:30:11.370 ---------------------------- Captured stdout setup -----------------------------
2025-06-16 05:30:11.375 Creating db: localhost:/var/tmp/qa_2024/test_11654/test.fdb [page_size=None, sql_dialect=None, charset='ASCII', 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('>=6.0')
def test_1(act: Action, capsys):
with act.db.connect() as con:
cur=con.cursor()
cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
fb_pid = int(cur.fetchone()[0])
times_map = {}
for i in range(0, N_MEASURES):
fb_info_init = psutil.Process(fb_pid).cpu_times()
cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
fb_info_curr = psutil.Process(fb_pid).cpu_times()
times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
fb_info_init = psutil.Process(fb_pid).cpu_times()
cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
fb_info_curr = psutil.Process(fb_pid).cpu_times()
times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
median_ratio = sp_udr_call_median / sp_gen_hash_median
print( 'Medians ratio: ' + ('acceptable' if median_ratio <= MAX_RATIO else '/* perf_issue_tag */ POOR: %s, more than threshold: %s' % ( '{:9g}'.format(median_ratio), '{:9g}'.format(MAX_RATIO) ) ) )
if median_ratio > MAX_RATIO:
print(f'CPU times for each of {N_MEASURES} measures:')
for sp_name in ('hash_eval', 'udr_call', ):
print(f'{sp_name=}:')
for p in [v for k,v in times_map.items() if k[0] == sp_name]:
print(p)
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E AssertionError: assert
E - Medians ratio: acceptable
E + Medians ratio: /* perf_issue_tag */ POOR: 4.63889, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.37
E + 0.3700000000000001
E + 0.3700000000000001
E + 0.3699999999999992
E + 0.33999999999999986
E + 0.3600000000000012
E + 0.34999999999999964
E + 0.3699999999999992
E + 0.3500000000000014
E + 0.38000000000000256
E + 0.35999999999999943
E + 0.370000000000001
E + 0.35999999999999943
E + 0.3500000000000014
E + 0.36999999999999744
E + 0.35999999999999943
E + 0.35999999999999943
E + 0.3399999999999963
E + 0.4399999999999977
E + 0.3500000000000014
E + 0.37999999999999545
E + sp_name='udr_call':
E + 1.66
E + 1.6599999999999997
E + 1.6800000000000006
E + 1.6799999999999997
E + 1.6500000000000004
E + 1.8599999999999994
E + 1.6500000000000004
E + 1.6899999999999995
E + 1.7199999999999989
E + 1.6099999999999994
E + 1.6899999999999977
E + 1.620000000000001
E + 1.6400000000000006
E + 1.8399999999999999
E + 1.6600000000000001
E + 1.740000000000002
E + 1.7100000000000009
E + 1.6700000000000017
E + 1.6700000000000017
E + 1.6600000000000037
E + 1.7000000000000028
tests/bugs/gh_7989_test.py:152: AssertionError
|