2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 5.17143, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.3500000000003638
+ 0.3600000000005821
+ 0.3500000000003638
+ 0.38000000000010914
+ 0.5299999999997453
+ 0.3500000000003638
+ 0.3500000000003638
+ 0.4499999999998181
+ 0.3500000000003638
+ 0.3599999999996726
+ 0.3400000000001455
+ 0.3599999999996726
+ 0.3500000000003638
+ 0.3500000000003638
+ 0.3600000000005821
+ 0.3499999999994543
+ 0.3499999999994543
+ 0.3400000000001455
+ 0.36999999999989086
+ 0.3500000000003638
+ 0.3499999999994543
+ sp_name='udr_call':
+ 1.769999999999527
+ 1.7599999999993088
+ 1.8100000000004002
+ 1.9399999999995998
+ 1.8299999999999272
+ 1.75
+ 1.9099999999998545
+ 1.8099999999994907
+ 1.8500000000003638
+ 1.800000000000182
+ 1.7299999999995634
+ 1.8400000000001455
+ 1.8299999999999272
+ 1.7999999999992724
+ 1.7600000000002183
+ 1.8500000000003638
+ 1.7700000000004366
+ 1.7799999999997453
+ 1.819999999999709
+ 1.800000000000182
+ 1.8200000000006185
LOG DETAILS:
2025-06-30 02:51:54.094
2025-06-30 02:51:54.099 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-30 02:51:54.104 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-30 02:51:54.110
2025-06-30 02:51:54.114 @pytest.mark.version('>=6.0')
2025-06-30 02:51:54.119 def test_1(act: Action, capsys):
2025-06-30 02:51:54.124
2025-06-30 02:51:54.129 with act.db.connect() as con:
2025-06-30 02:51:54.134 cur=con.cursor()
2025-06-30 02:51:54.139 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-30 02:51:54.144 fb_pid = int(cur.fetchone()[0])
2025-06-30 02:51:54.149
2025-06-30 02:51:54.154 times_map = {}
2025-06-30 02:51:54.159 for i in range(0, N_MEASURES):
2025-06-30 02:51:54.164 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-30 02:51:54.170 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-30 02:51:54.175 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-30 02:51:54.180 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-30 02:51:54.185
2025-06-30 02:51:54.190 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-30 02:51:54.195 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-30 02:51:54.200 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-30 02:51:54.204 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-30 02:51:54.209
2025-06-30 02:51:54.213
2025-06-30 02:51:54.219 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-30 02:51:54.224 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-30 02:51:54.229
2025-06-30 02:51:54.234 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-30 02:51:54.238
2025-06-30 02:51:54.244 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-30 02:51:54.249 if median_ratio > MAX_RATIO:
2025-06-30 02:51:54.254 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-30 02:51:54.259 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-30 02:51:54.264 print(f'{sp_name=}:')
2025-06-30 02:51:54.269 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-30 02:51:54.274 print(p)
2025-06-30 02:51:54.278
2025-06-30 02:51:54.283 act.expected_stdout = expected_stdout
2025-06-30 02:51:54.288 act.stdout = capsys.readouterr().out
2025-06-30 02:51:54.292 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-30 02:51:54.297 E AssertionError: assert
2025-06-30 02:51:54.301 E - Medians ratio: acceptable
2025-06-30 02:51:54.306 E + Medians ratio: /* perf_issue_tag */ POOR: 5.17143, more than threshold: 0.4
2025-06-30 02:51:54.311 E + CPU times for each of 21 measures:
2025-06-30 02:51:54.315 E + sp_name='hash_eval':
2025-06-30 02:51:54.320 E + 0.3500000000003638
2025-06-30 02:51:54.325 E + 0.3600000000005821
2025-06-30 02:51:54.330 E + 0.3500000000003638
2025-06-30 02:51:54.335 E + 0.38000000000010914
2025-06-30 02:51:54.341 E + 0.5299999999997453
2025-06-30 02:51:54.347 E + 0.3500000000003638
2025-06-30 02:51:54.351 E + 0.3500000000003638
2025-06-30 02:51:54.356 E + 0.4499999999998181
2025-06-30 02:51:54.361 E + 0.3500000000003638
2025-06-30 02:51:54.367 E + 0.3599999999996726
2025-06-30 02:51:54.371 E + 0.3400000000001455
2025-06-30 02:51:54.376 E + 0.3599999999996726
2025-06-30 02:51:54.381 E + 0.3500000000003638
2025-06-30 02:51:54.386 E + 0.3500000000003638
2025-06-30 02:51:54.391 E + 0.3600000000005821
2025-06-30 02:51:54.396 E + 0.3499999999994543
2025-06-30 02:51:54.401 E + 0.3499999999994543
2025-06-30 02:51:54.406 E + 0.3400000000001455
2025-06-30 02:51:54.411 E + 0.36999999999989086
2025-06-30 02:51:54.416 E + 0.3500000000003638
2025-06-30 02:51:54.421 E + 0.3499999999994543
2025-06-30 02:51:54.426 E + sp_name='udr_call':
2025-06-30 02:51:54.431 E + 1.769999999999527
2025-06-30 02:51:54.436 E + 1.7599999999993088
2025-06-30 02:51:54.441 E + 1.8100000000004002
2025-06-30 02:51:54.447 E + 1.9399999999995998
2025-06-30 02:51:54.452 E + 1.8299999999999272
2025-06-30 02:51:54.456 E + 1.75
2025-06-30 02:51:54.461 E + 1.9099999999998545
2025-06-30 02:51:54.466 E + 1.8099999999994907
2025-06-30 02:51:54.470 E + 1.8500000000003638
2025-06-30 02:51:54.476 E + 1.800000000000182
2025-06-30 02:51:54.481 E + 1.7299999999995634
2025-06-30 02:51:54.485 E + 1.8400000000001455
2025-06-30 02:51:54.490 E + 1.8299999999999272
2025-06-30 02:51:54.495 E + 1.7999999999992724
2025-06-30 02:51:54.500 E + 1.7600000000002183
2025-06-30 02:51:54.505 E + 1.8500000000003638
2025-06-30 02:51:54.510 E + 1.7700000000004366
2025-06-30 02:51:54.515 E + 1.7799999999997453
2025-06-30 02:51:54.520 E + 1.819999999999709
2025-06-30 02:51:54.525 E + 1.800000000000182
2025-06-30 02:51:54.530 E + 1.8200000000006185
2025-06-30 02:51:54.534
2025-06-30 02:51:54.539 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-30 02:51:54.543 ---------------------------- Captured stdout setup -----------------------------
2025-06-30 02:51:54.548 Creating db: localhost:/var/tmp/qa_2024/test_11662/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: 5.17143, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.3500000000003638
E + 0.3600000000005821
E + 0.3500000000003638
E + 0.38000000000010914
E + 0.5299999999997453
E + 0.3500000000003638
E + 0.3500000000003638
E + 0.4499999999998181
E + 0.3500000000003638
E + 0.3599999999996726
E + 0.3400000000001455
E + 0.3599999999996726
E + 0.3500000000003638
E + 0.3500000000003638
E + 0.3600000000005821
E + 0.3499999999994543
E + 0.3499999999994543
E + 0.3400000000001455
E + 0.36999999999989086
E + 0.3500000000003638
E + 0.3499999999994543
E + sp_name='udr_call':
E + 1.769999999999527
E + 1.7599999999993088
E + 1.8100000000004002
E + 1.9399999999995998
E + 1.8299999999999272
E + 1.75
E + 1.9099999999998545
E + 1.8099999999994907
E + 1.8500000000003638
E + 1.800000000000182
E + 1.7299999999995634
E + 1.8400000000001455
E + 1.8299999999999272
E + 1.7999999999992724
E + 1.7600000000002183
E + 1.8500000000003638
E + 1.7700000000004366
E + 1.7799999999997453
E + 1.819999999999709
E + 1.800000000000182
E + 1.8200000000006185
tests/bugs/gh_7989_test.py:152: AssertionError
|