2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 5, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.3500000000003638
+ 0.3500000000003638
+ 0.3599999999996726
+ 0.3599999999996726
+ 0.3499999999994543
+ 0.3400000000001455
+ 0.3500000000003638
+ 0.3400000000001455
+ 0.339999999999236
+ 0.36999999999989086
+ 0.3500000000003638
+ 0.36999999999989086
+ 0.4400000000005093
+ 0.3599999999996726
+ 0.3499999999994543
+ 0.38000000000010914
+ 0.3500000000003638
+ 0.3899999999994179
+ 0.3499999999994543
+ 0.3600000000005821
+ 0.3500000000003638
+ sp_name='udr_call':
+ 1.7099999999991269
+ 1.75
+ 1.8700000000008004
+ 1.800000000000182
+ 1.7899999999999636
+ 1.75
+ 1.7399999999997817
+ 1.6400000000003274
+ 1.6900000000005093
+ 1.75
+ 1.7199999999993452
+ 1.75
+ 1.800000000000182
+ 1.7200000000002547
+ 1.9700000000002547
+ 1.7399999999997817
+ 1.800000000000182
+ 1.9700000000002547
+ 1.800000000000182
+ 1.819999999999709
+ 1.7399999999997817
LOG DETAILS:
2025-07-02 03:00:09.554
2025-07-02 03:00:09.561 act = <firebird.qa.plugin.Action object at [hex]>
2025-07-02 03:00:09.567 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-07-02 03:00:09.574
2025-07-02 03:00:09.579 @pytest.mark.version('>=6.0')
2025-07-02 03:00:09.585 def test_1(act: Action, capsys):
2025-07-02 03:00:09.591
2025-07-02 03:00:09.597 with act.db.connect() as con:
2025-07-02 03:00:09.605 cur=con.cursor()
2025-07-02 03:00:09.612 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-07-02 03:00:09.619 fb_pid = int(cur.fetchone()[0])
2025-07-02 03:00:09.625
2025-07-02 03:00:09.631 times_map = {}
2025-07-02 03:00:09.636 for i in range(0, N_MEASURES):
2025-07-02 03:00:09.642 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-02 03:00:09.648 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-07-02 03:00:09.654 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-02 03:00:09.659 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-02 03:00:09.664
2025-07-02 03:00:09.669 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-02 03:00:09.673 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-07-02 03:00:09.678 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-02 03:00:09.683 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-02 03:00:09.687
2025-07-02 03:00:09.693
2025-07-02 03:00:09.698 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-07-02 03:00:09.705 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-07-02 03:00:09.711
2025-07-02 03:00:09.717 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-07-02 03:00:09.723
2025-07-02 03:00:09.729 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-07-02 03:00:09.737 if median_ratio > MAX_RATIO:
2025-07-02 03:00:09.742 print(f'CPU times for each of {N_MEASURES} measures:')
2025-07-02 03:00:09.749 for sp_name in ('hash_eval', 'udr_call', ):
2025-07-02 03:00:09.754 print(f'{sp_name=}:')
2025-07-02 03:00:09.759 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-07-02 03:00:09.764 print(p)
2025-07-02 03:00:09.769
2025-07-02 03:00:09.774 act.expected_stdout = expected_stdout
2025-07-02 03:00:09.780 act.stdout = capsys.readouterr().out
2025-07-02 03:00:09.785 > assert act.clean_stdout == act.clean_expected_stdout
2025-07-02 03:00:09.791 E AssertionError: assert
2025-07-02 03:00:09.797 E - Medians ratio: acceptable
2025-07-02 03:00:09.802 E + Medians ratio: /* perf_issue_tag */ POOR: 5, more than threshold: 0.4
2025-07-02 03:00:09.807 E + CPU times for each of 21 measures:
2025-07-02 03:00:09.812 E + sp_name='hash_eval':
2025-07-02 03:00:09.817 E + 0.3500000000003638
2025-07-02 03:00:09.822 E + 0.3500000000003638
2025-07-02 03:00:09.828 E + 0.3599999999996726
2025-07-02 03:00:09.833 E + 0.3599999999996726
2025-07-02 03:00:09.839 E + 0.3499999999994543
2025-07-02 03:00:09.845 E + 0.3400000000001455
2025-07-02 03:00:09.850 E + 0.3500000000003638
2025-07-02 03:00:09.856 E + 0.3400000000001455
2025-07-02 03:00:09.862 E + 0.339999999999236
2025-07-02 03:00:09.867 E + 0.36999999999989086
2025-07-02 03:00:09.873 E + 0.3500000000003638
2025-07-02 03:00:09.879 E + 0.36999999999989086
2025-07-02 03:00:09.885 E + 0.4400000000005093
2025-07-02 03:00:09.892 E + 0.3599999999996726
2025-07-02 03:00:09.898 E + 0.3499999999994543
2025-07-02 03:00:09.904 E + 0.38000000000010914
2025-07-02 03:00:09.911 E + 0.3500000000003638
2025-07-02 03:00:09.917 E + 0.3899999999994179
2025-07-02 03:00:09.923 E + 0.3499999999994543
2025-07-02 03:00:09.930 E + 0.3600000000005821
2025-07-02 03:00:09.937 E + 0.3500000000003638
2025-07-02 03:00:09.943 E + sp_name='udr_call':
2025-07-02 03:00:09.950 E + 1.7099999999991269
2025-07-02 03:00:09.957 E + 1.75
2025-07-02 03:00:09.963 E + 1.8700000000008004
2025-07-02 03:00:09.969 E + 1.800000000000182
2025-07-02 03:00:09.975 E + 1.7899999999999636
2025-07-02 03:00:09.982 E + 1.75
2025-07-02 03:00:09.989 E + 1.7399999999997817
2025-07-02 03:00:09.996 E + 1.6400000000003274
2025-07-02 03:00:10.003 E + 1.6900000000005093
2025-07-02 03:00:10.009 E + 1.75
2025-07-02 03:00:10.015 E + 1.7199999999993452
2025-07-02 03:00:10.022 E + 1.75
2025-07-02 03:00:10.028 E + 1.800000000000182
2025-07-02 03:00:10.035 E + 1.7200000000002547
2025-07-02 03:00:10.042 E + 1.9700000000002547
2025-07-02 03:00:10.050 E + 1.7399999999997817
2025-07-02 03:00:10.057 E + 1.800000000000182
2025-07-02 03:00:10.064 E + 1.9700000000002547
2025-07-02 03:00:10.071 E + 1.800000000000182
2025-07-02 03:00:10.077 E + 1.819999999999709
2025-07-02 03:00:10.084 E + 1.7399999999997817
2025-07-02 03:00:10.091
2025-07-02 03:00:10.099 tests/bugs/gh_7989_test.py:152: AssertionError
2025-07-02 03:00:10.106 ---------------------------- Captured stdout setup -----------------------------
2025-07-02 03:00:10.113 Creating db: localhost:/var/tmp/qa_2024/test_11663/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, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.3500000000003638
E + 0.3500000000003638
E + 0.3599999999996726
E + 0.3599999999996726
E + 0.3499999999994543
E + 0.3400000000001455
E + 0.3500000000003638
E + 0.3400000000001455
E + 0.339999999999236
E + 0.36999999999989086
E + 0.3500000000003638
E + 0.36999999999989086
E + 0.4400000000005093
E + 0.3599999999996726
E + 0.3499999999994543
E + 0.38000000000010914
E + 0.3500000000003638
E + 0.3899999999994179
E + 0.3499999999994543
E + 0.3600000000005821
E + 0.3500000000003638
E + sp_name='udr_call':
E + 1.7099999999991269
E + 1.75
E + 1.8700000000008004
E + 1.800000000000182
E + 1.7899999999999636
E + 1.75
E + 1.7399999999997817
E + 1.6400000000003274
E + 1.6900000000005093
E + 1.75
E + 1.7199999999993452
E + 1.75
E + 1.800000000000182
E + 1.7200000000002547
E + 1.9700000000002547
E + 1.7399999999997817
E + 1.800000000000182
E + 1.9700000000002547
E + 1.800000000000182
E + 1.819999999999709
E + 1.7399999999997817
tests/bugs/gh_7989_test.py:152: AssertionError
|