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.3700000000000001
+ 0.35999999999999943
+ 0.3600000000000003
+ 0.370000000000001
+ 0.3699999999999992
+ 0.34999999999999964
+ 0.35999999999999943
+ 0.35999999999999943
+ 0.40000000000000213
+ 0.3500000000000014
+ 0.379999999999999
+ 0.379999999999999
+ 0.35999999999999943
+ 0.379999999999999
+ 0.34999999999999787
+ 0.3500000000000014
+ 0.36000000000000654
+ 0.3500000000000014
+ 0.35999999999999943
+ 0.36999999999999744
+ sp_name='udr_call':
+ 1.69
+ 1.6600000000000001
+ 1.6600000000000001
+ 1.7699999999999996
+ 1.6899999999999995
+ 1.6900000000000013
+ 1.67
+ 1.660000000000002
+ 1.6899999999999977
+ 1.629999999999999
+ 1.6799999999999997
+ 1.6999999999999993
+ 1.620000000000001
+ 1.6500000000000021
+ 1.6900000000000013
+ 1.5700000000000003
+ 1.6999999999999957
+ 1.7999999999999972
+ 1.6299999999999955
+ 1.6100000000000065
+ 1.6700000000000017
LOG DETAILS:
2025-06-25 05:22:41.512
2025-06-25 05:22:41.521 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-25 05:22:41.528 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-25 05:22:41.534
2025-06-25 05:22:41.541 @pytest.mark.version('>=6.0')
2025-06-25 05:22:41.547 def test_1(act: Action, capsys):
2025-06-25 05:22:41.558
2025-06-25 05:22:41.567 with act.db.connect() as con:
2025-06-25 05:22:41.574 cur=con.cursor()
2025-06-25 05:22:41.581 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-25 05:22:41.587 fb_pid = int(cur.fetchone()[0])
2025-06-25 05:22:41.596
2025-06-25 05:22:41.606 times_map = {}
2025-06-25 05:22:41.617 for i in range(0, N_MEASURES):
2025-06-25 05:22:41.629 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-25 05:22:41.641 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-25 05:22:41.651 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-25 05:22:41.664 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-25 05:22:41.674
2025-06-25 05:22:41.686 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-25 05:22:41.697 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-25 05:22:41.707 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-25 05:22:41.715 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-25 05:22:41.721
2025-06-25 05:22:41.727
2025-06-25 05:22:41.733 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-25 05:22:41.738 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-25 05:22:41.748
2025-06-25 05:22:41.758 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-25 05:22:41.766
2025-06-25 05:22:41.774 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-25 05:22:41.786 if median_ratio > MAX_RATIO:
2025-06-25 05:22:41.794 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-25 05:22:41.802 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-25 05:22:41.812 print(f'{sp_name=}:')
2025-06-25 05:22:41.821 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-25 05:22:41.828 print(p)
2025-06-25 05:22:41.834
2025-06-25 05:22:41.841 act.expected_stdout = expected_stdout
2025-06-25 05:22:41.847 act.stdout = capsys.readouterr().out
2025-06-25 05:22:41.854 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-25 05:22:41.864 E AssertionError: assert
2025-06-25 05:22:41.873 E - Medians ratio: acceptable
2025-06-25 05:22:41.880 E + Medians ratio: /* perf_issue_tag */ POOR: 4.63889, more than threshold: 0.4
2025-06-25 05:22:41.887 E + CPU times for each of 21 measures:
2025-06-25 05:22:41.894 E + sp_name='hash_eval':
2025-06-25 05:22:41.903 E + 0.36
2025-06-25 05:22:41.911 E + 0.3700000000000001
2025-06-25 05:22:41.918 E + 0.35999999999999943
2025-06-25 05:22:41.926 E + 0.3600000000000003
2025-06-25 05:22:41.934 E + 0.370000000000001
2025-06-25 05:22:41.942 E + 0.3699999999999992
2025-06-25 05:22:41.949 E + 0.34999999999999964
2025-06-25 05:22:41.956 E + 0.35999999999999943
2025-06-25 05:22:41.963 E + 0.35999999999999943
2025-06-25 05:22:41.969 E + 0.40000000000000213
2025-06-25 05:22:41.976 E + 0.3500000000000014
2025-06-25 05:22:41.982 E + 0.379999999999999
2025-06-25 05:22:41.988 E + 0.379999999999999
2025-06-25 05:22:41.994 E + 0.35999999999999943
2025-06-25 05:22:42.005 E + 0.379999999999999
2025-06-25 05:22:42.014 E + 0.34999999999999787
2025-06-25 05:22:42.020 E + 0.3500000000000014
2025-06-25 05:22:42.025 E + 0.36000000000000654
2025-06-25 05:22:42.030 E + 0.3500000000000014
2025-06-25 05:22:42.034 E + 0.35999999999999943
2025-06-25 05:22:42.039 E + 0.36999999999999744
2025-06-25 05:22:42.043 E + sp_name='udr_call':
2025-06-25 05:22:42.048 E + 1.69
2025-06-25 05:22:42.052 E + 1.6600000000000001
2025-06-25 05:22:42.057 E + 1.6600000000000001
2025-06-25 05:22:42.066 E + 1.7699999999999996
2025-06-25 05:22:42.078 E + 1.6899999999999995
2025-06-25 05:22:42.085 E + 1.6900000000000013
2025-06-25 05:22:42.091 E + 1.67
2025-06-25 05:22:42.097 E + 1.660000000000002
2025-06-25 05:22:42.103 E + 1.6899999999999977
2025-06-25 05:22:42.109 E + 1.629999999999999
2025-06-25 05:22:42.114 E + 1.6799999999999997
2025-06-25 05:22:42.121 E + 1.6999999999999993
2025-06-25 05:22:42.127 E + 1.620000000000001
2025-06-25 05:22:42.135 E + 1.6500000000000021
2025-06-25 05:22:42.146 E + 1.6900000000000013
2025-06-25 05:22:42.155 E + 1.5700000000000003
2025-06-25 05:22:42.163 E + 1.6999999999999957
2025-06-25 05:22:42.170 E + 1.7999999999999972
2025-06-25 05:22:42.176 E + 1.6299999999999955
2025-06-25 05:22:42.185 E + 1.6100000000000065
2025-06-25 05:22:42.198 E + 1.6700000000000017
2025-06-25 05:22:42.207
2025-06-25 05:22:42.220 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-25 05:22:42.230 ---------------------------- Captured stdout setup -----------------------------
2025-06-25 05:22:42.238 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.3700000000000001
E + 0.35999999999999943
E + 0.3600000000000003
E + 0.370000000000001
E + 0.3699999999999992
E + 0.34999999999999964
E + 0.35999999999999943
E + 0.35999999999999943
E + 0.40000000000000213
E + 0.3500000000000014
E + 0.379999999999999
E + 0.379999999999999
E + 0.35999999999999943
E + 0.379999999999999
E + 0.34999999999999787
E + 0.3500000000000014
E + 0.36000000000000654
E + 0.3500000000000014
E + 0.35999999999999943
E + 0.36999999999999744
E + sp_name='udr_call':
E + 1.69
E + 1.6600000000000001
E + 1.6600000000000001
E + 1.7699999999999996
E + 1.6899999999999995
E + 1.6900000000000013
E + 1.67
E + 1.660000000000002
E + 1.6899999999999977
E + 1.629999999999999
E + 1.6799999999999997
E + 1.6999999999999993
E + 1.620000000000001
E + 1.6500000000000021
E + 1.6900000000000013
E + 1.5700000000000003
E + 1.6999999999999957
E + 1.7999999999999972
E + 1.6299999999999955
E + 1.6100000000000065
E + 1.6700000000000017
tests/bugs/gh_7989_test.py:152: AssertionError
|