2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.69444, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.38
+ 0.3700000000000001
+ 0.3600000000000003
+ 0.33999999999999986
+ 0.3699999999999992
+ 0.379999999999999
+ 0.34999999999999964
+ 0.3699999999999992
+ 0.35999999999999943
+ 0.360000000000003
+ 0.33999999999999986
+ 0.33999999999999986
+ 0.370000000000001
+ 0.39000000000000057
+ 0.35999999999999943
+ 0.38000000000000256
+ 0.35999999999999943
+ 0.35999999999999943
+ 0.3499999999999943
+ 0.38000000000000256
+ 0.3500000000000014
+ sp_name='udr_call':
+ 1.7000000000000002
+ 1.6899999999999995
+ 1.75
+ 1.7000000000000002
+ 1.6800000000000015
+ 1.700000000000001
+ 1.67
+ 1.700000000000001
+ 1.6699999999999982
+ 1.7999999999999972
+ 1.6800000000000033
+ 1.6999999999999993
+ 1.6499999999999986
+ 1.7300000000000004
+ 1.6699999999999982
+ 1.6000000000000014
+ 1.7100000000000009
+ 1.6799999999999997
+ 1.6600000000000037
+ 1.6699999999999946
+ 1.7199999999999989
LOG DETAILS:
2025-06-20 05:31:11.142
2025-06-20 05:31:11.148 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-20 05:31:11.155 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-20 05:31:11.161
2025-06-20 05:31:11.167 @pytest.mark.version('>=6.0')
2025-06-20 05:31:11.175 def test_1(act: Action, capsys):
2025-06-20 05:31:11.185
2025-06-20 05:31:11.194 with act.db.connect() as con:
2025-06-20 05:31:11.200 cur=con.cursor()
2025-06-20 05:31:11.206 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-20 05:31:11.211 fb_pid = int(cur.fetchone()[0])
2025-06-20 05:31:11.217
2025-06-20 05:31:11.222 times_map = {}
2025-06-20 05:31:11.230 for i in range(0, N_MEASURES):
2025-06-20 05:31:11.237 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-20 05:31:11.243 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-20 05:31:11.248 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-20 05:31:11.254 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-20 05:31:11.259
2025-06-20 05:31:11.265 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-20 05:31:11.270 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-20 05:31:11.277 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-20 05:31:11.285 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-20 05:31:11.292
2025-06-20 05:31:11.297
2025-06-20 05:31:11.303 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-20 05:31:11.309 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-20 05:31:11.315
2025-06-20 05:31:11.321 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-20 05:31:11.326
2025-06-20 05:31:11.331 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-20 05:31:11.336 if median_ratio > MAX_RATIO:
2025-06-20 05:31:11.341 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-20 05:31:11.346 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-20 05:31:11.352 print(f'{sp_name=}:')
2025-06-20 05:31:11.358 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-20 05:31:11.365 print(p)
2025-06-20 05:31:11.374
2025-06-20 05:31:11.382 act.expected_stdout = expected_stdout
2025-06-20 05:31:11.393 act.stdout = capsys.readouterr().out
2025-06-20 05:31:11.402 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-20 05:31:11.410 E AssertionError: assert
2025-06-20 05:31:11.417 E - Medians ratio: acceptable
2025-06-20 05:31:11.424 E + Medians ratio: /* perf_issue_tag */ POOR: 4.69444, more than threshold: 0.4
2025-06-20 05:31:11.430 E + CPU times for each of 21 measures:
2025-06-20 05:31:11.437 E + sp_name='hash_eval':
2025-06-20 05:31:11.443 E + 0.38
2025-06-20 05:31:11.451 E + 0.3700000000000001
2025-06-20 05:31:11.461 E + 0.3600000000000003
2025-06-20 05:31:11.473 E + 0.33999999999999986
2025-06-20 05:31:11.482 E + 0.3699999999999992
2025-06-20 05:31:11.492 E + 0.379999999999999
2025-06-20 05:31:11.504 E + 0.34999999999999964
2025-06-20 05:31:11.513 E + 0.3699999999999992
2025-06-20 05:31:11.525 E + 0.35999999999999943
2025-06-20 05:31:11.536 E + 0.360000000000003
2025-06-20 05:31:11.549 E + 0.33999999999999986
2025-06-20 05:31:11.557 E + 0.33999999999999986
2025-06-20 05:31:11.567 E + 0.370000000000001
2025-06-20 05:31:11.575 E + 0.39000000000000057
2025-06-20 05:31:11.583 E + 0.35999999999999943
2025-06-20 05:31:11.591 E + 0.38000000000000256
2025-06-20 05:31:11.601 E + 0.35999999999999943
2025-06-20 05:31:11.609 E + 0.35999999999999943
2025-06-20 05:31:11.616 E + 0.3499999999999943
2025-06-20 05:31:11.623 E + 0.38000000000000256
2025-06-20 05:31:11.632 E + 0.3500000000000014
2025-06-20 05:31:11.640 E + sp_name='udr_call':
2025-06-20 05:31:11.648 E + 1.7000000000000002
2025-06-20 05:31:11.654 E + 1.6899999999999995
2025-06-20 05:31:11.659 E + 1.75
2025-06-20 05:31:11.665 E + 1.7000000000000002
2025-06-20 05:31:11.671 E + 1.6800000000000015
2025-06-20 05:31:11.677 E + 1.700000000000001
2025-06-20 05:31:11.682 E + 1.67
2025-06-20 05:31:11.693 E + 1.700000000000001
2025-06-20 05:31:11.704 E + 1.6699999999999982
2025-06-20 05:31:11.711 E + 1.7999999999999972
2025-06-20 05:31:11.719 E + 1.6800000000000033
2025-06-20 05:31:11.730 E + 1.6999999999999993
2025-06-20 05:31:11.739 E + 1.6499999999999986
2025-06-20 05:31:11.747 E + 1.7300000000000004
2025-06-20 05:31:11.755 E + 1.6699999999999982
2025-06-20 05:31:11.762 E + 1.6000000000000014
2025-06-20 05:31:11.773 E + 1.7100000000000009
2025-06-20 05:31:11.784 E + 1.6799999999999997
2025-06-20 05:31:11.792 E + 1.6600000000000037
2025-06-20 05:31:11.799 E + 1.6699999999999946
2025-06-20 05:31:11.805 E + 1.7199999999999989
2025-06-20 05:31:11.811
2025-06-20 05:31:11.817 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-20 05:31:11.824 ---------------------------- Captured stdout setup -----------------------------
2025-06-20 05:31:11.831 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.69444, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.38
E + 0.3700000000000001
E + 0.3600000000000003
E + 0.33999999999999986
E + 0.3699999999999992
E + 0.379999999999999
E + 0.34999999999999964
E + 0.3699999999999992
E + 0.35999999999999943
E + 0.360000000000003
E + 0.33999999999999986
E + 0.33999999999999986
E + 0.370000000000001
E + 0.39000000000000057
E + 0.35999999999999943
E + 0.38000000000000256
E + 0.35999999999999943
E + 0.35999999999999943
E + 0.3499999999999943
E + 0.38000000000000256
E + 0.3500000000000014
E + sp_name='udr_call':
E + 1.7000000000000002
E + 1.6899999999999995
E + 1.75
E + 1.7000000000000002
E + 1.6800000000000015
E + 1.700000000000001
E + 1.67
E + 1.700000000000001
E + 1.6699999999999982
E + 1.7999999999999972
E + 1.6800000000000033
E + 1.6999999999999993
E + 1.6499999999999986
E + 1.7300000000000004
E + 1.6699999999999982
E + 1.6000000000000014
E + 1.7100000000000009
E + 1.6799999999999997
E + 1.6600000000000037
E + 1.6699999999999946
E + 1.7199999999999989
tests/bugs/gh_7989_test.py:152: AssertionError
|