2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.58333, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.38
+ 0.3700000000000001
+ 0.3600000000000003
+ 0.3700000000000001
+ 0.33999999999999986
+ 0.3699999999999992
+ 0.379999999999999
+ 0.3600000000000012
+ 0.34999999999999787
+ 0.379999999999999
+ 0.33999999999999986
+ 0.4200000000000017
+ 0.4400000000000013
+ 0.34999999999999787
+ 0.33999999999999986
+ 0.3500000000000014
+ 0.37999999999999545
+ 0.3500000000000014
+ 0.39000000000000057
+ 0.35999999999999943
+ 0.3400000000000034
+ sp_name='udr_call':
+ 1.66
+ 1.6799999999999997
+ 1.63
+ 1.6500000000000004
+ 1.6400000000000006
+ 1.6600000000000001
+ 1.6500000000000004
+ 1.6400000000000006
+ 1.6600000000000001
+ 1.7200000000000024
+ 1.629999999999999
+ 1.639999999999997
+ 1.6500000000000021
+ 1.740000000000002
+ 1.5999999999999979
+ 1.5800000000000018
+ 1.740000000000002
+ 1.6499999999999986
+ 1.6099999999999994
+ 1.6199999999999974
+ 1.6899999999999977
LOG DETAILS:
2025-07-03 05:19:11.515
2025-07-03 05:19:11.520 act = <firebird.qa.plugin.Action object at [hex]>
2025-07-03 05:19:11.526 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-07-03 05:19:11.532
2025-07-03 05:19:11.537 @pytest.mark.version('>=6.0')
2025-07-03 05:19:11.543 def test_1(act: Action, capsys):
2025-07-03 05:19:11.549
2025-07-03 05:19:11.554 with act.db.connect() as con:
2025-07-03 05:19:11.560 cur=con.cursor()
2025-07-03 05:19:11.566 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-07-03 05:19:11.572 fb_pid = int(cur.fetchone()[0])
2025-07-03 05:19:11.577
2025-07-03 05:19:11.584 times_map = {}
2025-07-03 05:19:11.590 for i in range(0, N_MEASURES):
2025-07-03 05:19:11.596 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-03 05:19:11.601 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-07-03 05:19:11.606 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-03 05:19:11.611 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-03 05:19:11.615
2025-07-03 05:19:11.621 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-03 05:19:11.626 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-07-03 05:19:11.632 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-03 05:19:11.638 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-03 05:19:11.644
2025-07-03 05:19:11.650
2025-07-03 05:19:11.660 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-07-03 05:19:11.669 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-07-03 05:19:11.676
2025-07-03 05:19:11.682 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-07-03 05:19:11.688
2025-07-03 05:19:11.694 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-07-03 05:19:11.699 if median_ratio > MAX_RATIO:
2025-07-03 05:19:11.705 print(f'CPU times for each of {N_MEASURES} measures:')
2025-07-03 05:19:11.711 for sp_name in ('hash_eval', 'udr_call', ):
2025-07-03 05:19:11.719 print(f'{sp_name=}:')
2025-07-03 05:19:11.729 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-07-03 05:19:11.737 print(p)
2025-07-03 05:19:11.744
2025-07-03 05:19:11.750 act.expected_stdout = expected_stdout
2025-07-03 05:19:11.755 act.stdout = capsys.readouterr().out
2025-07-03 05:19:11.761 > assert act.clean_stdout == act.clean_expected_stdout
2025-07-03 05:19:11.766 E AssertionError: assert
2025-07-03 05:19:11.772 E - Medians ratio: acceptable
2025-07-03 05:19:11.779 E + Medians ratio: /* perf_issue_tag */ POOR: 4.58333, more than threshold: 0.4
2025-07-03 05:19:11.791 E + CPU times for each of 21 measures:
2025-07-03 05:19:11.802 E + sp_name='hash_eval':
2025-07-03 05:19:11.810 E + 0.38
2025-07-03 05:19:11.820 E + 0.3700000000000001
2025-07-03 05:19:11.830 E + 0.3600000000000003
2025-07-03 05:19:11.839 E + 0.3700000000000001
2025-07-03 05:19:11.845 E + 0.33999999999999986
2025-07-03 05:19:11.851 E + 0.3699999999999992
2025-07-03 05:19:11.856 E + 0.379999999999999
2025-07-03 05:19:11.861 E + 0.3600000000000012
2025-07-03 05:19:11.866 E + 0.34999999999999787
2025-07-03 05:19:11.870 E + 0.379999999999999
2025-07-03 05:19:11.875 E + 0.33999999999999986
2025-07-03 05:19:11.880 E + 0.4200000000000017
2025-07-03 05:19:11.885 E + 0.4400000000000013
2025-07-03 05:19:11.889 E + 0.34999999999999787
2025-07-03 05:19:11.894 E + 0.33999999999999986
2025-07-03 05:19:11.898 E + 0.3500000000000014
2025-07-03 05:19:11.903 E + 0.37999999999999545
2025-07-03 05:19:11.907 E + 0.3500000000000014
2025-07-03 05:19:11.912 E + 0.39000000000000057
2025-07-03 05:19:11.916 E + 0.35999999999999943
2025-07-03 05:19:11.921 E + 0.3400000000000034
2025-07-03 05:19:11.926 E + sp_name='udr_call':
2025-07-03 05:19:11.931 E + 1.66
2025-07-03 05:19:11.935 E + 1.6799999999999997
2025-07-03 05:19:11.941 E + 1.63
2025-07-03 05:19:11.946 E + 1.6500000000000004
2025-07-03 05:19:11.950 E + 1.6400000000000006
2025-07-03 05:19:11.954 E + 1.6600000000000001
2025-07-03 05:19:11.959 E + 1.6500000000000004
2025-07-03 05:19:11.966 E + 1.6400000000000006
2025-07-03 05:19:11.972 E + 1.6600000000000001
2025-07-03 05:19:11.979 E + 1.7200000000000024
2025-07-03 05:19:11.986 E + 1.629999999999999
2025-07-03 05:19:11.997 E + 1.639999999999997
2025-07-03 05:19:12.006 E + 1.6500000000000021
2025-07-03 05:19:12.018 E + 1.740000000000002
2025-07-03 05:19:12.028 E + 1.5999999999999979
2025-07-03 05:19:12.034 E + 1.5800000000000018
2025-07-03 05:19:12.041 E + 1.740000000000002
2025-07-03 05:19:12.047 E + 1.6499999999999986
2025-07-03 05:19:12.052 E + 1.6099999999999994
2025-07-03 05:19:12.057 E + 1.6199999999999974
2025-07-03 05:19:12.061 E + 1.6899999999999977
2025-07-03 05:19:12.069
2025-07-03 05:19:12.074 tests/bugs/gh_7989_test.py:152: AssertionError
2025-07-03 05:19:12.080 ---------------------------- Captured stdout setup -----------------------------
2025-07-03 05:19:12.086 Creating db: localhost:/var/tmp/qa_2024/test_11663/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.58333, 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.3700000000000001
E + 0.33999999999999986
E + 0.3699999999999992
E + 0.379999999999999
E + 0.3600000000000012
E + 0.34999999999999787
E + 0.379999999999999
E + 0.33999999999999986
E + 0.4200000000000017
E + 0.4400000000000013
E + 0.34999999999999787
E + 0.33999999999999986
E + 0.3500000000000014
E + 0.37999999999999545
E + 0.3500000000000014
E + 0.39000000000000057
E + 0.35999999999999943
E + 0.3400000000000034
E + sp_name='udr_call':
E + 1.66
E + 1.6799999999999997
E + 1.63
E + 1.6500000000000004
E + 1.6400000000000006
E + 1.6600000000000001
E + 1.6500000000000004
E + 1.6400000000000006
E + 1.6600000000000001
E + 1.7200000000000024
E + 1.629999999999999
E + 1.639999999999997
E + 1.6500000000000021
E + 1.740000000000002
E + 1.5999999999999979
E + 1.5800000000000018
E + 1.740000000000002
E + 1.6499999999999986
E + 1.6099999999999994
E + 1.6199999999999974
E + 1.6899999999999977
tests/bugs/gh_7989_test.py:152: AssertionError
|