2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 5.02778, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.3599999999996726
+ 0.3599999999996726
+ 0.3599999999996726
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.43000000000029104
+ 0.3500000000003638
+ 0.3400000000001455
+ 0.3500000000003638
+ 0.3600000000005821
+ 0.3600000000005821
+ 0.3499999999994543
+ 0.37000000000080036
+ 0.3499999999994543
+ 0.37000000000080036
+ 0.3600000000005821
+ 0.3600000000005821
+ 0.36999999999989086
+ 0.3499999999994543
+ 0.36999999999989086
+ 0.3599999999996726
+ sp_name='udr_call':
+ 1.7200000000002547
+ 1.7800000000006548
+ 1.7399999999997817
+ 1.7399999999997817
+ 1.800000000000182
+ 1.8499999999994543
+ 1.8800000000001091
+ 1.769999999999527
+ 1.9299999999993815
+ 1.9299999999993815
+ 1.7899999999999636
+ 1.75
+ 1.819999999999709
+ 1.9600000000000364
+ 1.7999999999992724
+ 2.269999999999527
+ 1.9899999999997817
+ 1.7200000000002547
+ 1.8100000000004002
+ 1.8500000000003638
+ 1.8400000000001455
LOG DETAILS:
2025-06-29 02:49:45.919
2025-06-29 02:49:45.923 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-29 02:49:45.928 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-29 02:49:45.932
2025-06-29 02:49:45.937 @pytest.mark.version('>=6.0')
2025-06-29 02:49:45.941 def test_1(act: Action, capsys):
2025-06-29 02:49:45.946
2025-06-29 02:49:45.951 with act.db.connect() as con:
2025-06-29 02:49:45.955 cur=con.cursor()
2025-06-29 02:49:45.960 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-29 02:49:45.965 fb_pid = int(cur.fetchone()[0])
2025-06-29 02:49:45.969
2025-06-29 02:49:45.974 times_map = {}
2025-06-29 02:49:45.978 for i in range(0, N_MEASURES):
2025-06-29 02:49:45.983 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-29 02:49:45.988 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-29 02:49:45.993 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-29 02:49:45.998 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-29 02:49:46.002
2025-06-29 02:49:46.006 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-29 02:49:46.011 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-29 02:49:46.017 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-29 02:49:46.023 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-29 02:49:46.030
2025-06-29 02:49:46.037
2025-06-29 02:49:46.044 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-29 02:49:46.051 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-29 02:49:46.058
2025-06-29 02:49:46.065 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-29 02:49:46.071
2025-06-29 02:49:46.078 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-29 02:49:46.084 if median_ratio > MAX_RATIO:
2025-06-29 02:49:46.090 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-29 02:49:46.096 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-29 02:49:46.102 print(f'{sp_name=}:')
2025-06-29 02:49:46.109 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-29 02:49:46.115 print(p)
2025-06-29 02:49:46.121
2025-06-29 02:49:46.127 act.expected_stdout = expected_stdout
2025-06-29 02:49:46.134 act.stdout = capsys.readouterr().out
2025-06-29 02:49:46.140 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-29 02:49:46.146 E AssertionError: assert
2025-06-29 02:49:46.153 E - Medians ratio: acceptable
2025-06-29 02:49:46.159 E + Medians ratio: /* perf_issue_tag */ POOR: 5.02778, more than threshold: 0.4
2025-06-29 02:49:46.166 E + CPU times for each of 21 measures:
2025-06-29 02:49:46.172 E + sp_name='hash_eval':
2025-06-29 02:49:46.178 E + 0.3599999999996726
2025-06-29 02:49:46.185 E + 0.3599999999996726
2025-06-29 02:49:46.191 E + 0.3599999999996726
2025-06-29 02:49:46.198 E + 0.3400000000001455
2025-06-29 02:49:46.205 E + 0.3400000000001455
2025-06-29 02:49:46.211 E + 0.43000000000029104
2025-06-29 02:49:46.217 E + 0.3500000000003638
2025-06-29 02:49:46.223 E + 0.3400000000001455
2025-06-29 02:49:46.230 E + 0.3500000000003638
2025-06-29 02:49:46.236 E + 0.3600000000005821
2025-06-29 02:49:46.243 E + 0.3600000000005821
2025-06-29 02:49:46.248 E + 0.3499999999994543
2025-06-29 02:49:46.253 E + 0.37000000000080036
2025-06-29 02:49:46.257 E + 0.3499999999994543
2025-06-29 02:49:46.262 E + 0.37000000000080036
2025-06-29 02:49:46.266 E + 0.3600000000005821
2025-06-29 02:49:46.271 E + 0.3600000000005821
2025-06-29 02:49:46.275 E + 0.36999999999989086
2025-06-29 02:49:46.279 E + 0.3499999999994543
2025-06-29 02:49:46.284 E + 0.36999999999989086
2025-06-29 02:49:46.288 E + 0.3599999999996726
2025-06-29 02:49:46.293 E + sp_name='udr_call':
2025-06-29 02:49:46.297 E + 1.7200000000002547
2025-06-29 02:49:46.302 E + 1.7800000000006548
2025-06-29 02:49:46.306 E + 1.7399999999997817
2025-06-29 02:49:46.311 E + 1.7399999999997817
2025-06-29 02:49:46.316 E + 1.800000000000182
2025-06-29 02:49:46.320 E + 1.8499999999994543
2025-06-29 02:49:46.325 E + 1.8800000000001091
2025-06-29 02:49:46.329 E + 1.769999999999527
2025-06-29 02:49:46.334 E + 1.9299999999993815
2025-06-29 02:49:46.338 E + 1.9299999999993815
2025-06-29 02:49:46.343 E + 1.7899999999999636
2025-06-29 02:49:46.347 E + 1.75
2025-06-29 02:49:46.352 E + 1.819999999999709
2025-06-29 02:49:46.357 E + 1.9600000000000364
2025-06-29 02:49:46.361 E + 1.7999999999992724
2025-06-29 02:49:46.366 E + 2.269999999999527
2025-06-29 02:49:46.370 E + 1.9899999999997817
2025-06-29 02:49:46.375 E + 1.7200000000002547
2025-06-29 02:49:46.379 E + 1.8100000000004002
2025-06-29 02:49:46.384 E + 1.8500000000003638
2025-06-29 02:49:46.388 E + 1.8400000000001455
2025-06-29 02:49:46.393
2025-06-29 02:49:46.397 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-29 02:49:46.402 ---------------------------- Captured stdout setup -----------------------------
2025-06-29 02:49:46.407 Creating db: localhost:/var/tmp/qa_2024/test_11659/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.02778, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.3599999999996726
E + 0.3599999999996726
E + 0.3599999999996726
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.43000000000029104
E + 0.3500000000003638
E + 0.3400000000001455
E + 0.3500000000003638
E + 0.3600000000005821
E + 0.3600000000005821
E + 0.3499999999994543
E + 0.37000000000080036
E + 0.3499999999994543
E + 0.37000000000080036
E + 0.3600000000005821
E + 0.3600000000005821
E + 0.36999999999989086
E + 0.3499999999994543
E + 0.36999999999989086
E + 0.3599999999996726
E + sp_name='udr_call':
E + 1.7200000000002547
E + 1.7800000000006548
E + 1.7399999999997817
E + 1.7399999999997817
E + 1.800000000000182
E + 1.8499999999994543
E + 1.8800000000001091
E + 1.769999999999527
E + 1.9299999999993815
E + 1.9299999999993815
E + 1.7899999999999636
E + 1.75
E + 1.819999999999709
E + 1.9600000000000364
E + 1.7999999999992724
E + 2.269999999999527
E + 1.9899999999997817
E + 1.7200000000002547
E + 1.8100000000004002
E + 1.8500000000003638
E + 1.8400000000001455
tests/bugs/gh_7989_test.py:152: AssertionError
|