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.37000000000080036
+ 0.3900000000003274
+ 0.3499999999994543
+ 0.3500000000003638
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.3499999999994543
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.4599999999991269
+ 0.3600000000005821
+ 0.3900000000003274
+ 0.3400000000001455
+ 0.43000000000029104
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.3500000000003638
+ 0.3500000000003638
+ 0.3500000000003638
+ 0.32999999999992724
+ 0.339999999999236
+ sp_name='udr_call':
+ 1.7199999999993452
+ 1.800000000000182
+ 1.7600000000002183
+ 1.75
+ 1.7799999999997453
+ 1.699999999999818
+ 1.8900000000003274
+ 1.7600000000002183
+ 1.7100000000000364
+ 1.7100000000000364
+ 1.699999999999818
+ 1.819999999999709
+ 1.7399999999997817
+ 1.699999999999818
+ 1.7399999999997817
+ 1.7799999999997453
+ 1.7199999999993452
+ 1.6499999999996362
+ 1.7100000000000364
+ 1.6900000000005093
+ 1.7600000000002183
LOG DETAILS:
2025-06-13 02:59:56.031
2025-06-13 02:59:56.037 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-13 02:59:56.047 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-13 02:59:56.058
2025-06-13 02:59:56.067 @pytest.mark.version('>=6.0')
2025-06-13 02:59:56.074 def test_1(act: Action, capsys):
2025-06-13 02:59:56.079
2025-06-13 02:59:56.085 with act.db.connect() as con:
2025-06-13 02:59:56.089 cur=con.cursor()
2025-06-13 02:59:56.094 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-13 02:59:56.100 fb_pid = int(cur.fetchone()[0])
2025-06-13 02:59:56.104
2025-06-13 02:59:56.109 times_map = {}
2025-06-13 02:59:56.113 for i in range(0, N_MEASURES):
2025-06-13 02:59:56.118 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-13 02:59:56.123 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-13 02:59:56.128 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-13 02:59:56.133 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-13 02:59:56.138
2025-06-13 02:59:56.143 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-13 02:59:56.147 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-13 02:59:56.152 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-13 02:59:56.156 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-13 02:59:56.161
2025-06-13 02:59:56.165
2025-06-13 02:59:56.170 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-13 02:59:56.175 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-13 02:59:56.179
2025-06-13 02:59:56.183 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-13 02:59:56.188
2025-06-13 02:59:56.192 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-13 02:59:56.197 if median_ratio > MAX_RATIO:
2025-06-13 02:59:56.201 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-13 02:59:56.206 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-13 02:59:56.212 print(f'{sp_name=}:')
2025-06-13 02:59:56.216 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-13 02:59:56.221 print(p)
2025-06-13 02:59:56.225
2025-06-13 02:59:56.230 act.expected_stdout = expected_stdout
2025-06-13 02:59:56.234 act.stdout = capsys.readouterr().out
2025-06-13 02:59:56.239 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-13 02:59:56.243 E AssertionError: assert
2025-06-13 02:59:56.247 E - Medians ratio: acceptable
2025-06-13 02:59:56.252 E + Medians ratio: /* perf_issue_tag */ POOR: 4.97143, more than threshold: 0.4
2025-06-13 02:59:56.256 E + CPU times for each of 21 measures:
2025-06-13 02:59:56.261 E + sp_name='hash_eval':
2025-06-13 02:59:56.265 E + 0.37000000000080036
2025-06-13 02:59:56.270 E + 0.3900000000003274
2025-06-13 02:59:56.274 E + 0.3499999999994543
2025-06-13 02:59:56.278 E + 0.3500000000003638
2025-06-13 02:59:56.283 E + 0.3400000000001455
2025-06-13 02:59:56.287 E + 0.3400000000001455
2025-06-13 02:59:56.291 E + 0.3499999999994543
2025-06-13 02:59:56.296 E + 0.3400000000001455
2025-06-13 02:59:56.301 E + 0.3400000000001455
2025-06-13 02:59:56.305 E + 0.4599999999991269
2025-06-13 02:59:56.310 E + 0.3600000000005821
2025-06-13 02:59:56.316 E + 0.3900000000003274
2025-06-13 02:59:56.320 E + 0.3400000000001455
2025-06-13 02:59:56.325 E + 0.43000000000029104
2025-06-13 02:59:56.329 E + 0.3400000000001455
2025-06-13 02:59:56.333 E + 0.3400000000001455
2025-06-13 02:59:56.338 E + 0.3500000000003638
2025-06-13 02:59:56.342 E + 0.3500000000003638
2025-06-13 02:59:56.346 E + 0.3500000000003638
2025-06-13 02:59:56.351 E + 0.32999999999992724
2025-06-13 02:59:56.355 E + 0.339999999999236
2025-06-13 02:59:56.360 E + sp_name='udr_call':
2025-06-13 02:59:56.366 E + 1.7199999999993452
2025-06-13 02:59:56.370 E + 1.800000000000182
2025-06-13 02:59:56.374 E + 1.7600000000002183
2025-06-13 02:59:56.378 E + 1.75
2025-06-13 02:59:56.383 E + 1.7799999999997453
2025-06-13 02:59:56.387 E + 1.699999999999818
2025-06-13 02:59:56.392 E + 1.8900000000003274
2025-06-13 02:59:56.396 E + 1.7600000000002183
2025-06-13 02:59:56.401 E + 1.7100000000000364
2025-06-13 02:59:56.405 E + 1.7100000000000364
2025-06-13 02:59:56.410 E + 1.699999999999818
2025-06-13 02:59:56.414 E + 1.819999999999709
2025-06-13 02:59:56.418 E + 1.7399999999997817
2025-06-13 02:59:56.423 E + 1.699999999999818
2025-06-13 02:59:56.427 E + 1.7399999999997817
2025-06-13 02:59:56.432 E + 1.7799999999997453
2025-06-13 02:59:56.436 E + 1.7199999999993452
2025-06-13 02:59:56.441 E + 1.6499999999996362
2025-06-13 02:59:56.445 E + 1.7100000000000364
2025-06-13 02:59:56.450 E + 1.6900000000005093
2025-06-13 02:59:56.454 E + 1.7600000000002183
2025-06-13 02:59:56.458
2025-06-13 02:59:56.463 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-13 02:59:56.468 ---------------------------- Captured stdout setup -----------------------------
2025-06-13 02:59:56.474 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.37000000000080036
E + 0.3900000000003274
E + 0.3499999999994543
E + 0.3500000000003638
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.3499999999994543
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.4599999999991269
E + 0.3600000000005821
E + 0.3900000000003274
E + 0.3400000000001455
E + 0.43000000000029104
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.3500000000003638
E + 0.3500000000003638
E + 0.3500000000003638
E + 0.32999999999992724
E + 0.339999999999236
E + sp_name='udr_call':
E + 1.7199999999993452
E + 1.800000000000182
E + 1.7600000000002183
E + 1.75
E + 1.7799999999997453
E + 1.699999999999818
E + 1.8900000000003274
E + 1.7600000000002183
E + 1.7100000000000364
E + 1.7100000000000364
E + 1.699999999999818
E + 1.819999999999709
E + 1.7399999999997817
E + 1.699999999999818
E + 1.7399999999997817
E + 1.7799999999997453
E + 1.7199999999993452
E + 1.6499999999996362
E + 1.7100000000000364
E + 1.6900000000005093
E + 1.7600000000002183
tests/bugs/gh_7989_test.py:152: AssertionError
|