2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.63889, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.36
+ 0.3599999999999999
+ 0.35999999999999943
+ 0.34999999999999964
+ 0.370000000000001
+ 0.370000000000001
+ 0.35999999999999943
+ 0.3899999999999988
+ 0.379999999999999
+ 0.33999999999999986
+ 0.370000000000001
+ 0.35999999999999943
+ 0.36999999999999744
+ 0.370000000000001
+ 0.3500000000000014
+ 0.35999999999999943
+ 0.3500000000000014
+ 0.4100000000000037
+ 0.4200000000000017
+ 0.5799999999999983
+ 0.35999999999999943
+ sp_name='udr_call':
+ 1.6500000000000001
+ 1.6900000000000004
+ 1.7000000000000002
+ 1.6799999999999997
+ 1.6199999999999992
+ 1.6999999999999993
+ 1.6800000000000015
+ 1.6500000000000004
+ 1.6700000000000017
+ 1.6799999999999997
+ 1.6499999999999986
+ 1.6300000000000026
+ 1.6400000000000006
+ 1.6699999999999982
+ 1.6799999999999997
+ 1.6700000000000017
+ 1.7399999999999949
+ 1.6599999999999966
+ 1.7199999999999989
+ 1.7600000000000051
+ 1.6700000000000017
LOG DETAILS:
2025-06-21 05:34:55.814
2025-06-21 05:34:55.826 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-21 05:34:55.834 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-21 05:34:55.839
2025-06-21 05:34:55.845 @pytest.mark.version('>=6.0')
2025-06-21 05:34:55.850 def test_1(act: Action, capsys):
2025-06-21 05:34:55.857
2025-06-21 05:34:55.863 with act.db.connect() as con:
2025-06-21 05:34:55.869 cur=con.cursor()
2025-06-21 05:34:55.875 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-21 05:34:55.879 fb_pid = int(cur.fetchone()[0])
2025-06-21 05:34:55.884
2025-06-21 05:34:55.889 times_map = {}
2025-06-21 05:34:55.893 for i in range(0, N_MEASURES):
2025-06-21 05:34:55.904 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-21 05:34:55.913 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-21 05:34:55.920 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-21 05:34:55.926 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-21 05:34:55.933
2025-06-21 05:34:55.941 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-21 05:34:55.948 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-21 05:34:55.954 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-21 05:34:55.959 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-21 05:34:55.964
2025-06-21 05:34:55.969
2025-06-21 05:34:55.974 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-21 05:34:55.980 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-21 05:34:55.986
2025-06-21 05:34:55.990 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-21 05:34:55.995
2025-06-21 05:34:56.000 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 05:34:56.005 if median_ratio > MAX_RATIO:
2025-06-21 05:34:56.010 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-21 05:34:56.015 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-21 05:34:56.020 print(f'{sp_name=}:')
2025-06-21 05:34:56.029 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-21 05:34:56.041 print(p)
2025-06-21 05:34:56.054
2025-06-21 05:34:56.065 act.expected_stdout = expected_stdout
2025-06-21 05:34:56.074 act.stdout = capsys.readouterr().out
2025-06-21 05:34:56.084 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-21 05:34:56.094 E AssertionError: assert
2025-06-21 05:34:56.104 E - Medians ratio: acceptable
2025-06-21 05:34:56.114 E + Medians ratio: /* perf_issue_tag */ POOR: 4.63889, more than threshold: 0.4
2025-06-21 05:34:56.123 E + CPU times for each of 21 measures:
2025-06-21 05:34:56.130 E + sp_name='hash_eval':
2025-06-21 05:34:56.139 E + 0.36
2025-06-21 05:34:56.152 E + 0.3599999999999999
2025-06-21 05:34:56.163 E + 0.35999999999999943
2025-06-21 05:34:56.173 E + 0.34999999999999964
2025-06-21 05:34:56.181 E + 0.370000000000001
2025-06-21 05:34:56.188 E + 0.370000000000001
2025-06-21 05:34:56.194 E + 0.35999999999999943
2025-06-21 05:34:56.201 E + 0.3899999999999988
2025-06-21 05:34:56.214 E + 0.379999999999999
2025-06-21 05:34:56.226 E + 0.33999999999999986
2025-06-21 05:34:56.237 E + 0.370000000000001
2025-06-21 05:34:56.250 E + 0.35999999999999943
2025-06-21 05:34:56.260 E + 0.36999999999999744
2025-06-21 05:34:56.268 E + 0.370000000000001
2025-06-21 05:34:56.275 E + 0.3500000000000014
2025-06-21 05:34:56.282 E + 0.35999999999999943
2025-06-21 05:34:56.288 E + 0.3500000000000014
2025-06-21 05:34:56.294 E + 0.4100000000000037
2025-06-21 05:34:56.300 E + 0.4200000000000017
2025-06-21 05:34:56.309 E + 0.5799999999999983
2025-06-21 05:34:56.320 E + 0.35999999999999943
2025-06-21 05:34:56.328 E + sp_name='udr_call':
2025-06-21 05:34:56.336 E + 1.6500000000000001
2025-06-21 05:34:56.343 E + 1.6900000000000004
2025-06-21 05:34:56.351 E + 1.7000000000000002
2025-06-21 05:34:56.362 E + 1.6799999999999997
2025-06-21 05:34:56.370 E + 1.6199999999999992
2025-06-21 05:34:56.375 E + 1.6999999999999993
2025-06-21 05:34:56.382 E + 1.6800000000000015
2025-06-21 05:34:56.392 E + 1.6500000000000004
2025-06-21 05:34:56.401 E + 1.6700000000000017
2025-06-21 05:34:56.409 E + 1.6799999999999997
2025-06-21 05:34:56.415 E + 1.6499999999999986
2025-06-21 05:34:56.421 E + 1.6300000000000026
2025-06-21 05:34:56.425 E + 1.6400000000000006
2025-06-21 05:34:56.430 E + 1.6699999999999982
2025-06-21 05:34:56.435 E + 1.6799999999999997
2025-06-21 05:34:56.442 E + 1.6700000000000017
2025-06-21 05:34:56.450 E + 1.7399999999999949
2025-06-21 05:34:56.457 E + 1.6599999999999966
2025-06-21 05:34:56.463 E + 1.7199999999999989
2025-06-21 05:34:56.468 E + 1.7600000000000051
2025-06-21 05:34:56.474 E + 1.6700000000000017
2025-06-21 05:34:56.479
2025-06-21 05:34:56.487 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-21 05:34:56.497 ---------------------------- Captured stdout setup -----------------------------
2025-06-21 05:34:56.505 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.63889, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.36
E + 0.3599999999999999
E + 0.35999999999999943
E + 0.34999999999999964
E + 0.370000000000001
E + 0.370000000000001
E + 0.35999999999999943
E + 0.3899999999999988
E + 0.379999999999999
E + 0.33999999999999986
E + 0.370000000000001
E + 0.35999999999999943
E + 0.36999999999999744
E + 0.370000000000001
E + 0.3500000000000014
E + 0.35999999999999943
E + 0.3500000000000014
E + 0.4100000000000037
E + 0.4200000000000017
E + 0.5799999999999983
E + 0.35999999999999943
E + sp_name='udr_call':
E + 1.6500000000000001
E + 1.6900000000000004
E + 1.7000000000000002
E + 1.6799999999999997
E + 1.6199999999999992
E + 1.6999999999999993
E + 1.6800000000000015
E + 1.6500000000000004
E + 1.6700000000000017
E + 1.6799999999999997
E + 1.6499999999999986
E + 1.6300000000000026
E + 1.6400000000000006
E + 1.6699999999999982
E + 1.6799999999999997
E + 1.6700000000000017
E + 1.7399999999999949
E + 1.6599999999999966
E + 1.7199999999999989
E + 1.7600000000000051
E + 1.6700000000000017
tests/bugs/gh_7989_test.py:152: AssertionError
|