2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.88571, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.36000000000012733
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.42000000000007276
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.34999999999990905
+ 0.3599999999996726
+ 0.34999999999990905
+ 0.33999999999969077
+ 0.38000000000010914
+ 0.34999999999990905
+ 0.36999999999989086
+ 0.34999999999990905
+ 0.34999999999990905
+ 0.34999999999990905
+ 0.3400000000001455
+ 0.36000000000012733
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.3700000000003456
+ sp_name='udr_call':
+ 1.699999999999818
+ 1.699999999999818
+ 1.7100000000000364
+ 1.7899999999999636
+ 1.7099999999995816
+ 1.75
+ 1.7000000000002728
+ 1.7400000000002365
+ 1.7200000000002547
+ 1.75
+ 1.75
+ 1.7000000000002728
+ 1.7100000000000364
+ 1.7100000000000364
+ 1.6700000000000728
+ 1.7100000000000364
+ 1.6799999999998363
+ 1.6799999999998363
+ 1.699999999999818
+ 1.7399999999997817
+ 1.7899999999999636
LOG DETAILS:
2025-06-27 02:41:06.387
2025-06-27 02:41:06.392 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-27 02:41:06.398 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-27 02:41:06.403
2025-06-27 02:41:06.408 @pytest.mark.version('>=6.0')
2025-06-27 02:41:06.412 def test_1(act: Action, capsys):
2025-06-27 02:41:06.417
2025-06-27 02:41:06.421 with act.db.connect() as con:
2025-06-27 02:41:06.426 cur=con.cursor()
2025-06-27 02:41:06.430 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-27 02:41:06.435 fb_pid = int(cur.fetchone()[0])
2025-06-27 02:41:06.439
2025-06-27 02:41:06.443 times_map = {}
2025-06-27 02:41:06.448 for i in range(0, N_MEASURES):
2025-06-27 02:41:06.453 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-27 02:41:06.457 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-27 02:41:06.462 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-27 02:41:06.467 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-27 02:41:06.471
2025-06-27 02:41:06.475 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-27 02:41:06.481 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-27 02:41:06.486 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-27 02:41:06.491 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-27 02:41:06.496
2025-06-27 02:41:06.501
2025-06-27 02:41:06.505 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-27 02:41:06.510 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-27 02:41:06.514
2025-06-27 02:41:06.519 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-27 02:41:06.523
2025-06-27 02:41:06.528 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-27 02:41:06.533 if median_ratio > MAX_RATIO:
2025-06-27 02:41:06.537 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-27 02:41:06.542 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-27 02:41:06.546 print(f'{sp_name=}:')
2025-06-27 02:41:06.551 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-27 02:41:06.555 print(p)
2025-06-27 02:41:06.559
2025-06-27 02:41:06.564 act.expected_stdout = expected_stdout
2025-06-27 02:41:06.568 act.stdout = capsys.readouterr().out
2025-06-27 02:41:06.573 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-27 02:41:06.577 E AssertionError: assert
2025-06-27 02:41:06.582 E - Medians ratio: acceptable
2025-06-27 02:41:06.586 E + Medians ratio: /* perf_issue_tag */ POOR: 4.88571, more than threshold: 0.4
2025-06-27 02:41:06.591 E + CPU times for each of 21 measures:
2025-06-27 02:41:06.595 E + sp_name='hash_eval':
2025-06-27 02:41:06.599 E + 0.36000000000012733
2025-06-27 02:41:06.604 E + 0.3400000000001455
2025-06-27 02:41:06.608 E + 0.3400000000001455
2025-06-27 02:41:06.612 E + 0.42000000000007276
2025-06-27 02:41:06.617 E + 0.3400000000001455
2025-06-27 02:41:06.621 E + 0.3400000000001455
2025-06-27 02:41:06.625 E + 0.34999999999990905
2025-06-27 02:41:06.630 E + 0.3599999999996726
2025-06-27 02:41:06.634 E + 0.34999999999990905
2025-06-27 02:41:06.639 E + 0.33999999999969077
2025-06-27 02:41:06.643 E + 0.38000000000010914
2025-06-27 02:41:06.648 E + 0.34999999999990905
2025-06-27 02:41:06.653 E + 0.36999999999989086
2025-06-27 02:41:06.657 E + 0.34999999999990905
2025-06-27 02:41:06.662 E + 0.34999999999990905
2025-06-27 02:41:06.666 E + 0.34999999999990905
2025-06-27 02:41:06.671 E + 0.3400000000001455
2025-06-27 02:41:06.677 E + 0.36000000000012733
2025-06-27 02:41:06.681 E + 0.3400000000001455
2025-06-27 02:41:06.686 E + 0.3400000000001455
2025-06-27 02:41:06.690 E + 0.3700000000003456
2025-06-27 02:41:06.695 E + sp_name='udr_call':
2025-06-27 02:41:06.699 E + 1.699999999999818
2025-06-27 02:41:06.704 E + 1.699999999999818
2025-06-27 02:41:06.708 E + 1.7100000000000364
2025-06-27 02:41:06.712 E + 1.7899999999999636
2025-06-27 02:41:06.717 E + 1.7099999999995816
2025-06-27 02:41:06.721 E + 1.75
2025-06-27 02:41:06.726 E + 1.7000000000002728
2025-06-27 02:41:06.731 E + 1.7400000000002365
2025-06-27 02:41:06.736 E + 1.7200000000002547
2025-06-27 02:41:06.740 E + 1.75
2025-06-27 02:41:06.744 E + 1.75
2025-06-27 02:41:06.749 E + 1.7000000000002728
2025-06-27 02:41:06.753 E + 1.7100000000000364
2025-06-27 02:41:06.758 E + 1.7100000000000364
2025-06-27 02:41:06.762 E + 1.6700000000000728
2025-06-27 02:41:06.768 E + 1.7100000000000364
2025-06-27 02:41:06.773 E + 1.6799999999998363
2025-06-27 02:41:06.778 E + 1.6799999999998363
2025-06-27 02:41:06.782 E + 1.699999999999818
2025-06-27 02:41:06.787 E + 1.7399999999997817
2025-06-27 02:41:06.791 E + 1.7899999999999636
2025-06-27 02:41:06.795
2025-06-27 02:41:06.799 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-27 02:41:06.804 ---------------------------- Captured stdout setup -----------------------------
2025-06-27 02:41:06.808 Creating db: localhost:/var/tmp/qa_2024/test_11655/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.88571, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.36000000000012733
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.42000000000007276
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.34999999999990905
E + 0.3599999999996726
E + 0.34999999999990905
E + 0.33999999999969077
E + 0.38000000000010914
E + 0.34999999999990905
E + 0.36999999999989086
E + 0.34999999999990905
E + 0.34999999999990905
E + 0.34999999999990905
E + 0.3400000000001455
E + 0.36000000000012733
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.3700000000003456
E + sp_name='udr_call':
E + 1.699999999999818
E + 1.699999999999818
E + 1.7100000000000364
E + 1.7899999999999636
E + 1.7099999999995816
E + 1.75
E + 1.7000000000002728
E + 1.7400000000002365
E + 1.7200000000002547
E + 1.75
E + 1.75
E + 1.7000000000002728
E + 1.7100000000000364
E + 1.7100000000000364
E + 1.6700000000000728
E + 1.7100000000000364
E + 1.6799999999998363
E + 1.6799999999998363
E + 1.699999999999818
E + 1.7399999999997817
E + 1.7899999999999636
tests/bugs/gh_7989_test.py:152: AssertionError
|