2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 5.14286, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.38000000000010914
+ 0.3400000000001455
+ 0.33999999999969077
+ 0.36999999999989086
+ 0.38999999999987267
+ 0.32999999999992724
+ 0.34999999999990905
+ 0.3500000000003638
+ 0.38999999999987267
+ 0.3599999999996726
+ 0.34999999999990905
+ 0.34999999999990905
+ 0.3400000000001455
+ 0.3700000000003456
+ 0.34999999999990905
+ 0.38999999999987267
+ 0.32999999999992724
+ 0.36999999999989086
+ 0.3599999999996726
+ 0.3500000000003638
+ 0.3499999999994543
+ sp_name='udr_call':
+ 1.7399999999997817
+ 1.8400000000001455
+ 1.7600000000002183
+ 1.8600000000001273
+ 1.7100000000000364
+ 1.7400000000002365
+ 1.7599999999997635
+ 1.7799999999997453
+ 1.8500000000003638
+ 1.8500000000003638
+ 1.7899999999999636
+ 1.7699999999999818
+ 1.7999999999997272
+ 1.849999999999909
+ 1.8099999999999454
+ 1.7800000000002
+ 1.8200000000001637
+ 1.8200000000001637
+ 1.75
+ 1.849999999999909
+ 1.8200000000006185
LOG DETAILS:
2025-06-20 02:49:24.242
2025-06-20 02:49:24.247 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-20 02:49:24.251 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-20 02:49:24.255
2025-06-20 02:49:24.259 @pytest.mark.version('>=6.0')
2025-06-20 02:49:24.264 def test_1(act: Action, capsys):
2025-06-20 02:49:24.268
2025-06-20 02:49:24.272 with act.db.connect() as con:
2025-06-20 02:49:24.276 cur=con.cursor()
2025-06-20 02:49:24.281 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-20 02:49:24.285 fb_pid = int(cur.fetchone()[0])
2025-06-20 02:49:24.290
2025-06-20 02:49:24.294 times_map = {}
2025-06-20 02:49:24.299 for i in range(0, N_MEASURES):
2025-06-20 02:49:24.304 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-20 02:49:24.309 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-20 02:49:24.314 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-20 02:49:24.319 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-20 02:49:24.325
2025-06-20 02:49:24.330 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-20 02:49:24.335 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-20 02:49:24.340 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-20 02:49:24.345 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-20 02:49:24.349
2025-06-20 02:49:24.355
2025-06-20 02:49:24.360 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-20 02:49:24.365 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-20 02:49:24.370
2025-06-20 02:49:24.375 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-20 02:49:24.380
2025-06-20 02:49:24.385 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-20 02:49:24.390 if median_ratio > MAX_RATIO:
2025-06-20 02:49:24.394 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-20 02:49:24.399 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-20 02:49:24.404 print(f'{sp_name=}:')
2025-06-20 02:49:24.409 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-20 02:49:24.414 print(p)
2025-06-20 02:49:24.420
2025-06-20 02:49:24.425 act.expected_stdout = expected_stdout
2025-06-20 02:49:24.429 act.stdout = capsys.readouterr().out
2025-06-20 02:49:24.434 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-20 02:49:24.438 E AssertionError: assert
2025-06-20 02:49:24.442 E - Medians ratio: acceptable
2025-06-20 02:49:24.447 E + Medians ratio: /* perf_issue_tag */ POOR: 5.14286, more than threshold: 0.4
2025-06-20 02:49:24.451 E + CPU times for each of 21 measures:
2025-06-20 02:49:24.455 E + sp_name='hash_eval':
2025-06-20 02:49:24.459 E + 0.38000000000010914
2025-06-20 02:49:24.464 E + 0.3400000000001455
2025-06-20 02:49:24.468 E + 0.33999999999969077
2025-06-20 02:49:24.472 E + 0.36999999999989086
2025-06-20 02:49:24.477 E + 0.38999999999987267
2025-06-20 02:49:24.481 E + 0.32999999999992724
2025-06-20 02:49:24.486 E + 0.34999999999990905
2025-06-20 02:49:24.491 E + 0.3500000000003638
2025-06-20 02:49:24.495 E + 0.38999999999987267
2025-06-20 02:49:24.499 E + 0.3599999999996726
2025-06-20 02:49:24.504 E + 0.34999999999990905
2025-06-20 02:49:24.508 E + 0.34999999999990905
2025-06-20 02:49:24.513 E + 0.3400000000001455
2025-06-20 02:49:24.518 E + 0.3700000000003456
2025-06-20 02:49:24.522 E + 0.34999999999990905
2025-06-20 02:49:24.526 E + 0.38999999999987267
2025-06-20 02:49:24.531 E + 0.32999999999992724
2025-06-20 02:49:24.537 E + 0.36999999999989086
2025-06-20 02:49:24.541 E + 0.3599999999996726
2025-06-20 02:49:24.545 E + 0.3500000000003638
2025-06-20 02:49:24.550 E + 0.3499999999994543
2025-06-20 02:49:24.554 E + sp_name='udr_call':
2025-06-20 02:49:24.559 E + 1.7399999999997817
2025-06-20 02:49:24.563 E + 1.8400000000001455
2025-06-20 02:49:24.569 E + 1.7600000000002183
2025-06-20 02:49:24.573 E + 1.8600000000001273
2025-06-20 02:49:24.577 E + 1.7100000000000364
2025-06-20 02:49:24.582 E + 1.7400000000002365
2025-06-20 02:49:24.586 E + 1.7599999999997635
2025-06-20 02:49:24.590 E + 1.7799999999997453
2025-06-20 02:49:24.595 E + 1.8500000000003638
2025-06-20 02:49:24.600 E + 1.8500000000003638
2025-06-20 02:49:24.604 E + 1.7899999999999636
2025-06-20 02:49:24.609 E + 1.7699999999999818
2025-06-20 02:49:24.613 E + 1.7999999999997272
2025-06-20 02:49:24.617 E + 1.849999999999909
2025-06-20 02:49:24.622 E + 1.8099999999999454
2025-06-20 02:49:24.626 E + 1.7800000000002
2025-06-20 02:49:24.631 E + 1.8200000000001637
2025-06-20 02:49:24.635 E + 1.8200000000001637
2025-06-20 02:49:24.640 E + 1.75
2025-06-20 02:49:24.645 E + 1.849999999999909
2025-06-20 02:49:24.649 E + 1.8200000000006185
2025-06-20 02:49:24.653
2025-06-20 02:49:24.658 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-20 02:49:24.663 ---------------------------- Captured stdout setup -----------------------------
2025-06-20 02:49:24.668 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: 5.14286, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.38000000000010914
E + 0.3400000000001455
E + 0.33999999999969077
E + 0.36999999999989086
E + 0.38999999999987267
E + 0.32999999999992724
E + 0.34999999999990905
E + 0.3500000000003638
E + 0.38999999999987267
E + 0.3599999999996726
E + 0.34999999999990905
E + 0.34999999999990905
E + 0.3400000000001455
E + 0.3700000000003456
E + 0.34999999999990905
E + 0.38999999999987267
E + 0.32999999999992724
E + 0.36999999999989086
E + 0.3599999999996726
E + 0.3500000000003638
E + 0.3499999999994543
E + sp_name='udr_call':
E + 1.7399999999997817
E + 1.8400000000001455
E + 1.7600000000002183
E + 1.8600000000001273
E + 1.7100000000000364
E + 1.7400000000002365
E + 1.7599999999997635
E + 1.7799999999997453
E + 1.8500000000003638
E + 1.8500000000003638
E + 1.7899999999999636
E + 1.7699999999999818
E + 1.7999999999997272
E + 1.849999999999909
E + 1.8099999999999454
E + 1.7800000000002
E + 1.8200000000001637
E + 1.8200000000001637
E + 1.75
E + 1.849999999999909
E + 1.8200000000006185
tests/bugs/gh_7989_test.py:152: AssertionError
|