2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 5.02941, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.3400000000001455
+ 0.33999999999969077
+ 0.34999999999990905
+ 0.3700000000003456
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.33999999999969077
+ 0.3400000000001455
+ 0.33999999999969077
+ 0.32999999999992724
+ 0.33999999999969077
+ 0.34999999999990905
+ 0.34999999999990905
+ 0.3799999999996544
+ 0.33999999999969077
+ 0.36000000000012733
+ 0.34999999999990905
+ 0.34999999999990905
+ 0.34999999999990905
+ 0.32999999999992724
+ 0.34999999999990905
+ sp_name='udr_call':
+ 1.680000000000291
+ 1.6700000000000728
+ 1.7699999999999818
+ 1.7299999999995634
+ 1.75
+ 1.7100000000000364
+ 1.7200000000002547
+ 1.7300000000000182
+ 1.7400000000002365
+ 1.7100000000000364
+ 1.7600000000002183
+ 1.6900000000000546
+ 1.7000000000002728
+ 1.7000000000002728
+ 1.75
+ 1.7100000000000364
+ 1.7000000000002728
+ 1.6799999999998363
+ 1.7200000000002547
+ 1.6700000000000728
+ 1.6799999999998363
LOG DETAILS:
2025-06-26 02:43:00.099
2025-06-26 02:43:00.103 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-26 02:43:00.107 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-26 02:43:00.112
2025-06-26 02:43:00.116 @pytest.mark.version('>=6.0')
2025-06-26 02:43:00.120 def test_1(act: Action, capsys):
2025-06-26 02:43:00.125
2025-06-26 02:43:00.129 with act.db.connect() as con:
2025-06-26 02:43:00.133 cur=con.cursor()
2025-06-26 02:43:00.138 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-26 02:43:00.142 fb_pid = int(cur.fetchone()[0])
2025-06-26 02:43:00.146
2025-06-26 02:43:00.151 times_map = {}
2025-06-26 02:43:00.155 for i in range(0, N_MEASURES):
2025-06-26 02:43:00.159 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-26 02:43:00.164 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-26 02:43:00.168 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-26 02:43:00.173 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-26 02:43:00.177
2025-06-26 02:43:00.182 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-26 02:43:00.186 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-26 02:43:00.190 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-26 02:43:00.195 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-26 02:43:00.199
2025-06-26 02:43:00.203
2025-06-26 02:43:00.208 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-26 02:43:00.212 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-26 02:43:00.217
2025-06-26 02:43:00.221 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-26 02:43:00.225
2025-06-26 02:43:00.230 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-26 02:43:00.235 if median_ratio > MAX_RATIO:
2025-06-26 02:43:00.239 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-26 02:43:00.244 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-26 02:43:00.248 print(f'{sp_name=}:')
2025-06-26 02:43:00.253 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-26 02:43:00.257 print(p)
2025-06-26 02:43:00.261
2025-06-26 02:43:00.266 act.expected_stdout = expected_stdout
2025-06-26 02:43:00.270 act.stdout = capsys.readouterr().out
2025-06-26 02:43:00.275 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-26 02:43:00.279 E AssertionError: assert
2025-06-26 02:43:00.283 E - Medians ratio: acceptable
2025-06-26 02:43:00.288 E + Medians ratio: /* perf_issue_tag */ POOR: 5.02941, more than threshold: 0.4
2025-06-26 02:43:00.292 E + CPU times for each of 21 measures:
2025-06-26 02:43:00.296 E + sp_name='hash_eval':
2025-06-26 02:43:00.300 E + 0.3400000000001455
2025-06-26 02:43:00.305 E + 0.33999999999969077
2025-06-26 02:43:00.309 E + 0.34999999999990905
2025-06-26 02:43:00.313 E + 0.3700000000003456
2025-06-26 02:43:00.318 E + 0.3400000000001455
2025-06-26 02:43:00.322 E + 0.3400000000001455
2025-06-26 02:43:00.326 E + 0.33999999999969077
2025-06-26 02:43:00.331 E + 0.3400000000001455
2025-06-26 02:43:00.335 E + 0.33999999999969077
2025-06-26 02:43:00.340 E + 0.32999999999992724
2025-06-26 02:43:00.345 E + 0.33999999999969077
2025-06-26 02:43:00.350 E + 0.34999999999990905
2025-06-26 02:43:00.354 E + 0.34999999999990905
2025-06-26 02:43:00.359 E + 0.3799999999996544
2025-06-26 02:43:00.363 E + 0.33999999999969077
2025-06-26 02:43:00.367 E + 0.36000000000012733
2025-06-26 02:43:00.372 E + 0.34999999999990905
2025-06-26 02:43:00.376 E + 0.34999999999990905
2025-06-26 02:43:00.381 E + 0.34999999999990905
2025-06-26 02:43:00.385 E + 0.32999999999992724
2025-06-26 02:43:00.390 E + 0.34999999999990905
2025-06-26 02:43:00.394 E + sp_name='udr_call':
2025-06-26 02:43:00.398 E + 1.680000000000291
2025-06-26 02:43:00.403 E + 1.6700000000000728
2025-06-26 02:43:00.407 E + 1.7699999999999818
2025-06-26 02:43:00.411 E + 1.7299999999995634
2025-06-26 02:43:00.416 E + 1.75
2025-06-26 02:43:00.420 E + 1.7100000000000364
2025-06-26 02:43:00.424 E + 1.7200000000002547
2025-06-26 02:43:00.429 E + 1.7300000000000182
2025-06-26 02:43:00.433 E + 1.7400000000002365
2025-06-26 02:43:00.437 E + 1.7100000000000364
2025-06-26 02:43:00.441 E + 1.7600000000002183
2025-06-26 02:43:00.446 E + 1.6900000000000546
2025-06-26 02:43:00.450 E + 1.7000000000002728
2025-06-26 02:43:00.454 E + 1.7000000000002728
2025-06-26 02:43:00.459 E + 1.75
2025-06-26 02:43:00.463 E + 1.7100000000000364
2025-06-26 02:43:00.467 E + 1.7000000000002728
2025-06-26 02:43:00.472 E + 1.6799999999998363
2025-06-26 02:43:00.476 E + 1.7200000000002547
2025-06-26 02:43:00.480 E + 1.6700000000000728
2025-06-26 02:43:00.485 E + 1.6799999999998363
2025-06-26 02:43:00.489
2025-06-26 02:43:00.493 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-26 02:43:00.497 ---------------------------- Captured stdout setup -----------------------------
2025-06-26 02:43:00.502 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.02941, 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.34999999999990905
E + 0.3700000000003456
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.33999999999969077
E + 0.3400000000001455
E + 0.33999999999969077
E + 0.32999999999992724
E + 0.33999999999969077
E + 0.34999999999990905
E + 0.34999999999990905
E + 0.3799999999996544
E + 0.33999999999969077
E + 0.36000000000012733
E + 0.34999999999990905
E + 0.34999999999990905
E + 0.34999999999990905
E + 0.32999999999992724
E + 0.34999999999990905
E + sp_name='udr_call':
E + 1.680000000000291
E + 1.6700000000000728
E + 1.7699999999999818
E + 1.7299999999995634
E + 1.75
E + 1.7100000000000364
E + 1.7200000000002547
E + 1.7300000000000182
E + 1.7400000000002365
E + 1.7100000000000364
E + 1.7600000000002183
E + 1.6900000000000546
E + 1.7000000000002728
E + 1.7000000000002728
E + 1.75
E + 1.7100000000000364
E + 1.7000000000002728
E + 1.6799999999998363
E + 1.7200000000002547
E + 1.6700000000000728
E + 1.6799999999998363
tests/bugs/gh_7989_test.py:152: AssertionError
|