2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 5.11429, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.3400000000001455
+ 0.33999999999969077
+ 0.33999999999969077
+ 0.3400000000001455
+ 0.34999999999990905
+ 0.38000000000010914
+ 0.34999999999990905
+ 0.3400000000001455
+ 0.34999999999990905
+ 0.36999999999989086
+ 0.34999999999990905
+ 0.3500000000003638
+ 0.37000000000080036
+ 0.3599999999996726
+ 0.36999999999989086
+ 0.3500000000003638
+ 0.3500000000003638
+ 0.3500000000003638
+ 0.38000000000010914
+ 0.32999999999992724
+ 0.3500000000003638
+ sp_name='udr_call':
+ 1.8899999999998727
+ 1.7900000000004184
+ 1.7899999999999636
+ 1.8200000000001637
+ 1.9099999999998545
+ 1.7899999999999636
+ 1.8400000000001455
+ 1.8699999999998909
+ 1.849999999999909
+ 1.800000000000182
+ 1.75
+ 1.7599999999993088
+ 1.7299999999995634
+ 1.7200000000002547
+ 1.7899999999999636
+ 1.75
+ 1.7299999999995634
+ 1.7799999999997453
+ 1.819999999999709
+ 1.7399999999997817
+ 1.7899999999999636
LOG DETAILS:
2025-06-21 02:53:56.903
2025-06-21 02:53:56.908 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-21 02:53:56.912 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-21 02:53:56.917
2025-06-21 02:53:56.924 @pytest.mark.version('>=6.0')
2025-06-21 02:53:56.932 def test_1(act: Action, capsys):
2025-06-21 02:53:56.937
2025-06-21 02:53:56.941 with act.db.connect() as con:
2025-06-21 02:53:56.945 cur=con.cursor()
2025-06-21 02:53:56.950 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-21 02:53:56.954 fb_pid = int(cur.fetchone()[0])
2025-06-21 02:53:56.958
2025-06-21 02:53:56.962 times_map = {}
2025-06-21 02:53:56.967 for i in range(0, N_MEASURES):
2025-06-21 02:53:56.971 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-21 02:53:56.975 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-21 02:53:56.980 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-21 02:53:56.984 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-21 02:53:56.988
2025-06-21 02:53:56.993 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-21 02:53:56.998 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-21 02:53:57.002 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-21 02:53:57.007 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-21 02:53:57.011
2025-06-21 02:53:57.016
2025-06-21 02:53:57.022 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-21 02:53:57.027 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-21 02:53:57.031
2025-06-21 02:53:57.036 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-21 02:53:57.040
2025-06-21 02:53:57.045 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-21 02:53:57.050 if median_ratio > MAX_RATIO:
2025-06-21 02:53:57.055 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-21 02:53:57.059 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-21 02:53:57.064 print(f'{sp_name=}:')
2025-06-21 02:53:57.068 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-21 02:53:57.073 print(p)
2025-06-21 02:53:57.077
2025-06-21 02:53:57.082 act.expected_stdout = expected_stdout
2025-06-21 02:53:57.086 act.stdout = capsys.readouterr().out
2025-06-21 02:53:57.091 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-21 02:53:57.095 E AssertionError: assert
2025-06-21 02:53:57.100 E - Medians ratio: acceptable
2025-06-21 02:53:57.105 E + Medians ratio: /* perf_issue_tag */ POOR: 5.11429, more than threshold: 0.4
2025-06-21 02:53:57.110 E + CPU times for each of 21 measures:
2025-06-21 02:53:57.115 E + sp_name='hash_eval':
2025-06-21 02:53:57.119 E + 0.3400000000001455
2025-06-21 02:53:57.124 E + 0.33999999999969077
2025-06-21 02:53:57.129 E + 0.33999999999969077
2025-06-21 02:53:57.133 E + 0.3400000000001455
2025-06-21 02:53:57.138 E + 0.34999999999990905
2025-06-21 02:53:57.142 E + 0.38000000000010914
2025-06-21 02:53:57.147 E + 0.34999999999990905
2025-06-21 02:53:57.151 E + 0.3400000000001455
2025-06-21 02:53:57.156 E + 0.34999999999990905
2025-06-21 02:53:57.160 E + 0.36999999999989086
2025-06-21 02:53:57.165 E + 0.34999999999990905
2025-06-21 02:53:57.169 E + 0.3500000000003638
2025-06-21 02:53:57.174 E + 0.37000000000080036
2025-06-21 02:53:57.178 E + 0.3599999999996726
2025-06-21 02:53:57.182 E + 0.36999999999989086
2025-06-21 02:53:57.187 E + 0.3500000000003638
2025-06-21 02:53:57.191 E + 0.3500000000003638
2025-06-21 02:53:57.196 E + 0.3500000000003638
2025-06-21 02:53:57.201 E + 0.38000000000010914
2025-06-21 02:53:57.205 E + 0.32999999999992724
2025-06-21 02:53:57.209 E + 0.3500000000003638
2025-06-21 02:53:57.214 E + sp_name='udr_call':
2025-06-21 02:53:57.218 E + 1.8899999999998727
2025-06-21 02:53:57.223 E + 1.7900000000004184
2025-06-21 02:53:57.228 E + 1.7899999999999636
2025-06-21 02:53:57.232 E + 1.8200000000001637
2025-06-21 02:53:57.237 E + 1.9099999999998545
2025-06-21 02:53:57.241 E + 1.7899999999999636
2025-06-21 02:53:57.246 E + 1.8400000000001455
2025-06-21 02:53:57.250 E + 1.8699999999998909
2025-06-21 02:53:57.254 E + 1.849999999999909
2025-06-21 02:53:57.259 E + 1.800000000000182
2025-06-21 02:53:57.264 E + 1.75
2025-06-21 02:53:57.269 E + 1.7599999999993088
2025-06-21 02:53:57.274 E + 1.7299999999995634
2025-06-21 02:53:57.280 E + 1.7200000000002547
2025-06-21 02:53:57.285 E + 1.7899999999999636
2025-06-21 02:53:57.291 E + 1.75
2025-06-21 02:53:57.296 E + 1.7299999999995634
2025-06-21 02:53:57.300 E + 1.7799999999997453
2025-06-21 02:53:57.305 E + 1.819999999999709
2025-06-21 02:53:57.309 E + 1.7399999999997817
2025-06-21 02:53:57.313 E + 1.7899999999999636
2025-06-21 02:53:57.318
2025-06-21 02:53:57.322 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-21 02:53:57.327 ---------------------------- Captured stdout setup -----------------------------
2025-06-21 02:53:57.331 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.11429, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.3400000000001455
E + 0.33999999999969077
E + 0.33999999999969077
E + 0.3400000000001455
E + 0.34999999999990905
E + 0.38000000000010914
E + 0.34999999999990905
E + 0.3400000000001455
E + 0.34999999999990905
E + 0.36999999999989086
E + 0.34999999999990905
E + 0.3500000000003638
E + 0.37000000000080036
E + 0.3599999999996726
E + 0.36999999999989086
E + 0.3500000000003638
E + 0.3500000000003638
E + 0.3500000000003638
E + 0.38000000000010914
E + 0.32999999999992724
E + 0.3500000000003638
E + sp_name='udr_call':
E + 1.8899999999998727
E + 1.7900000000004184
E + 1.7899999999999636
E + 1.8200000000001637
E + 1.9099999999998545
E + 1.7899999999999636
E + 1.8400000000001455
E + 1.8699999999998909
E + 1.849999999999909
E + 1.800000000000182
E + 1.75
E + 1.7599999999993088
E + 1.7299999999995634
E + 1.7200000000002547
E + 1.7899999999999636
E + 1.75
E + 1.7299999999995634
E + 1.7799999999997453
E + 1.819999999999709
E + 1.7399999999997817
E + 1.7899999999999636
tests/bugs/gh_7989_test.py:152: AssertionError
|