2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.97143, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.3500000000003638
+ 0.3400000000001455
+ 0.3600000000005821
+ 0.3600000000005821
+ 0.36999999999989086
+ 0.3600000000005821
+ 0.3400000000001455
+ 0.3599999999996726
+ 0.3500000000003638
+ 0.38000000000010914
+ 0.3499999999994543
+ 0.3500000000003638
+ 0.3599999999996726
+ 0.3499999999994543
+ 0.38000000000010914
+ 0.3499999999994543
+ 0.36999999999989086
+ 0.3400000000001455
+ 0.3499999999994543
+ 0.3599999999996726
+ 0.3500000000003638
+ sp_name='udr_call':
+ 1.7399999999997817
+ 1.6899999999995998
+ 1.7199999999993452
+ 1.75
+ 1.6899999999995998
+ 1.699999999999818
+ 1.7399999999997817
+ 1.800000000000182
+ 1.75
+ 1.7799999999997453
+ 1.730000000000473
+ 1.7799999999997453
+ 1.730000000000473
+ 1.7200000000002547
+ 1.800000000000182
+ 1.7800000000006548
+ 1.7199999999993452
+ 1.7800000000006548
+ 1.7600000000002183
+ 1.7399999999997817
+ 1.7600000000002183
LOG DETAILS:
2025-06-14 02:56:00.842
2025-06-14 02:56:00.857 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-14 02:56:00.869 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-14 02:56:00.881
2025-06-14 02:56:00.900 @pytest.mark.version('>=6.0')
2025-06-14 02:56:00.910 def test_1(act: Action, capsys):
2025-06-14 02:56:00.918
2025-06-14 02:56:00.926 with act.db.connect() as con:
2025-06-14 02:56:00.934 cur=con.cursor()
2025-06-14 02:56:00.954 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-14 02:56:00.962 fb_pid = int(cur.fetchone()[0])
2025-06-14 02:56:00.979
2025-06-14 02:56:00.989 times_map = {}
2025-06-14 02:56:01.003 for i in range(0, N_MEASURES):
2025-06-14 02:56:01.019 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-14 02:56:01.031 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-14 02:56:01.046 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-14 02:56:01.061 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-14 02:56:01.074
2025-06-14 02:56:01.089 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-14 02:56:01.102 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-14 02:56:01.118 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-14 02:56:01.133 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-14 02:56:01.146
2025-06-14 02:56:01.158
2025-06-14 02:56:01.166 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-14 02:56:01.185 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-14 02:56:01.194
2025-06-14 02:56:01.201 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-14 02:56:01.219
2025-06-14 02:56:01.233 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-14 02:56:01.249 if median_ratio > MAX_RATIO:
2025-06-14 02:56:01.266 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-14 02:56:01.278 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-14 02:56:01.286 print(f'{sp_name=}:')
2025-06-14 02:56:01.296 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-14 02:56:01.314 print(p)
2025-06-14 02:56:01.326
2025-06-14 02:56:01.338 act.expected_stdout = expected_stdout
2025-06-14 02:56:01.350 act.stdout = capsys.readouterr().out
2025-06-14 02:56:01.360 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-14 02:56:01.377 E AssertionError: assert
2025-06-14 02:56:01.386 E - Medians ratio: acceptable
2025-06-14 02:56:01.398 E + Medians ratio: /* perf_issue_tag */ POOR: 4.97143, more than threshold: 0.4
2025-06-14 02:56:01.409 E + CPU times for each of 21 measures:
2025-06-14 02:56:01.418 E + sp_name='hash_eval':
2025-06-14 02:56:01.429 E + 0.3500000000003638
2025-06-14 02:56:01.438 E + 0.3400000000001455
2025-06-14 02:56:01.454 E + 0.3600000000005821
2025-06-14 02:56:01.466 E + 0.3600000000005821
2025-06-14 02:56:01.477 E + 0.36999999999989086
2025-06-14 02:56:01.489 E + 0.3600000000005821
2025-06-14 02:56:01.502 E + 0.3400000000001455
2025-06-14 02:56:01.513 E + 0.3599999999996726
2025-06-14 02:56:01.530 E + 0.3500000000003638
2025-06-14 02:56:01.542 E + 0.38000000000010914
2025-06-14 02:56:01.554 E + 0.3499999999994543
2025-06-14 02:56:01.562 E + 0.3500000000003638
2025-06-14 02:56:01.574 E + 0.3599999999996726
2025-06-14 02:56:01.582 E + 0.3499999999994543
2025-06-14 02:56:01.595 E + 0.38000000000010914
2025-06-14 02:56:01.606 E + 0.3499999999994543
2025-06-14 02:56:01.614 E + 0.36999999999989086
2025-06-14 02:56:01.627 E + 0.3400000000001455
2025-06-14 02:56:01.642 E + 0.3499999999994543
2025-06-14 02:56:01.653 E + 0.3599999999996726
2025-06-14 02:56:01.662 E + 0.3500000000003638
2025-06-14 02:56:01.674 E + sp_name='udr_call':
2025-06-14 02:56:01.685 E + 1.7399999999997817
2025-06-14 02:56:01.698 E + 1.6899999999995998
2025-06-14 02:56:01.708 E + 1.7199999999993452
2025-06-14 02:56:01.722 E + 1.75
2025-06-14 02:56:01.734 E + 1.6899999999995998
2025-06-14 02:56:01.745 E + 1.699999999999818
2025-06-14 02:56:01.764 E + 1.7399999999997817
2025-06-14 02:56:01.778 E + 1.800000000000182
2025-06-14 02:56:01.794 E + 1.75
2025-06-14 02:56:01.806 E + 1.7799999999997453
2025-06-14 02:56:01.822 E + 1.730000000000473
2025-06-14 02:56:01.837 E + 1.7799999999997453
2025-06-14 02:56:01.847 E + 1.730000000000473
2025-06-14 02:56:01.867 E + 1.7200000000002547
2025-06-14 02:56:01.883 E + 1.800000000000182
2025-06-14 02:56:01.903 E + 1.7800000000006548
2025-06-14 02:56:01.919 E + 1.7199999999993452
2025-06-14 02:56:01.929 E + 1.7800000000006548
2025-06-14 02:56:01.946 E + 1.7600000000002183
2025-06-14 02:56:01.958 E + 1.7399999999997817
2025-06-14 02:56:01.971 E + 1.7600000000002183
2025-06-14 02:56:01.989
2025-06-14 02:56:02.002 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-14 02:56:02.010 ---------------------------- Captured stdout setup -----------------------------
2025-06-14 02:56:02.022 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.97143, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.3500000000003638
E + 0.3400000000001455
E + 0.3600000000005821
E + 0.3600000000005821
E + 0.36999999999989086
E + 0.3600000000005821
E + 0.3400000000001455
E + 0.3599999999996726
E + 0.3500000000003638
E + 0.38000000000010914
E + 0.3499999999994543
E + 0.3500000000003638
E + 0.3599999999996726
E + 0.3499999999994543
E + 0.38000000000010914
E + 0.3499999999994543
E + 0.36999999999989086
E + 0.3400000000001455
E + 0.3499999999994543
E + 0.3599999999996726
E + 0.3500000000003638
E + sp_name='udr_call':
E + 1.7399999999997817
E + 1.6899999999995998
E + 1.7199999999993452
E + 1.75
E + 1.6899999999995998
E + 1.699999999999818
E + 1.7399999999997817
E + 1.800000000000182
E + 1.75
E + 1.7799999999997453
E + 1.730000000000473
E + 1.7799999999997453
E + 1.730000000000473
E + 1.7200000000002547
E + 1.800000000000182
E + 1.7800000000006548
E + 1.7199999999993452
E + 1.7800000000006548
E + 1.7600000000002183
E + 1.7399999999997817
E + 1.7600000000002183
tests/bugs/gh_7989_test.py:152: AssertionError
|