2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.85714, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.34999999999990905
+ 0.34999999999990905
+ 0.3400000000001455
+ 0.36999999999989086
+ 0.3700000000003456
+ 0.3500000000003638
+ 0.3400000000001455
+ 0.38999999999987267
+ 0.36999999999989086
+ 0.36000000000012733
+ 0.3400000000001455
+ 0.3400000000001455
+ 0.44000000000005457
+ 0.34999999999990905
+ 0.33999999999969077
+ 0.3400000000001455
+ 0.34999999999990905
+ 0.36000000000012733
+ 0.33999999999969077
+ 0.32999999999992724
+ 0.3400000000001455
+ sp_name='udr_call':
+ 1.6900000000000546
+ 1.7100000000000364
+ 1.7399999999997817
+ 1.6900000000000546
+ 1.6899999999995998
+ 1.6499999999996362
+ 1.7100000000000364
+ 1.680000000000291
+ 1.6900000000000546
+ 1.6499999999996362
+ 1.699999999999818
+ 1.699999999999818
+ 1.8200000000001637
+ 1.7400000000002365
+ 1.6900000000000546
+ 1.6900000000000546
+ 1.7300000000000182
+ 1.75
+ 1.7200000000002547
+ 1.7599999999997635
+ 1.6900000000000546
LOG DETAILS:
2025-06-24 02:42:57.681
2025-06-24 02:42:57.685 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-24 02:42:57.689 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-24 02:42:57.694
2025-06-24 02:42:57.698 @pytest.mark.version('>=6.0')
2025-06-24 02:42:57.702 def test_1(act: Action, capsys):
2025-06-24 02:42:57.707
2025-06-24 02:42:57.711 with act.db.connect() as con:
2025-06-24 02:42:57.715 cur=con.cursor()
2025-06-24 02:42:57.720 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-24 02:42:57.724 fb_pid = int(cur.fetchone()[0])
2025-06-24 02:42:57.729
2025-06-24 02:42:57.733 times_map = {}
2025-06-24 02:42:57.737 for i in range(0, N_MEASURES):
2025-06-24 02:42:57.742 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-24 02:42:57.746 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-24 02:42:57.751 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-24 02:42:57.755 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-24 02:42:57.760
2025-06-24 02:42:57.764 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-24 02:42:57.768 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-24 02:42:57.773 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-24 02:42:57.777 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-24 02:42:57.783
2025-06-24 02:42:57.789
2025-06-24 02:42:57.795 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-24 02:42:57.801 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-24 02:42:57.808
2025-06-24 02:42:57.814 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-24 02:42:57.820
2025-06-24 02:42:57.826 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-24 02:42:57.832 if median_ratio > MAX_RATIO:
2025-06-24 02:42:57.836 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-24 02:42:57.841 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-24 02:42:57.845 print(f'{sp_name=}:')
2025-06-24 02:42:57.849 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-24 02:42:57.854 print(p)
2025-06-24 02:42:57.858
2025-06-24 02:42:57.862 act.expected_stdout = expected_stdout
2025-06-24 02:42:57.866 act.stdout = capsys.readouterr().out
2025-06-24 02:42:57.871 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-24 02:42:57.875 E AssertionError: assert
2025-06-24 02:42:57.879 E - Medians ratio: acceptable
2025-06-24 02:42:57.884 E + Medians ratio: /* perf_issue_tag */ POOR: 4.85714, more than threshold: 0.4
2025-06-24 02:42:57.888 E + CPU times for each of 21 measures:
2025-06-24 02:42:57.892 E + sp_name='hash_eval':
2025-06-24 02:42:57.896 E + 0.34999999999990905
2025-06-24 02:42:57.900 E + 0.34999999999990905
2025-06-24 02:42:57.905 E + 0.3400000000001455
2025-06-24 02:42:57.909 E + 0.36999999999989086
2025-06-24 02:42:57.913 E + 0.3700000000003456
2025-06-24 02:42:57.917 E + 0.3500000000003638
2025-06-24 02:42:57.922 E + 0.3400000000001455
2025-06-24 02:42:57.927 E + 0.38999999999987267
2025-06-24 02:42:57.933 E + 0.36999999999989086
2025-06-24 02:42:57.938 E + 0.36000000000012733
2025-06-24 02:42:57.942 E + 0.3400000000001455
2025-06-24 02:42:57.946 E + 0.3400000000001455
2025-06-24 02:42:57.950 E + 0.44000000000005457
2025-06-24 02:42:57.955 E + 0.34999999999990905
2025-06-24 02:42:57.959 E + 0.33999999999969077
2025-06-24 02:42:57.963 E + 0.3400000000001455
2025-06-24 02:42:57.968 E + 0.34999999999990905
2025-06-24 02:42:57.972 E + 0.36000000000012733
2025-06-24 02:42:57.976 E + 0.33999999999969077
2025-06-24 02:42:57.980 E + 0.32999999999992724
2025-06-24 02:42:57.984 E + 0.3400000000001455
2025-06-24 02:42:57.989 E + sp_name='udr_call':
2025-06-24 02:42:57.993 E + 1.6900000000000546
2025-06-24 02:42:57.997 E + 1.7100000000000364
2025-06-24 02:42:58.001 E + 1.7399999999997817
2025-06-24 02:42:58.006 E + 1.6900000000000546
2025-06-24 02:42:58.011 E + 1.6899999999995998
2025-06-24 02:42:58.015 E + 1.6499999999996362
2025-06-24 02:42:58.019 E + 1.7100000000000364
2025-06-24 02:42:58.024 E + 1.680000000000291
2025-06-24 02:42:58.028 E + 1.6900000000000546
2025-06-24 02:42:58.032 E + 1.6499999999996362
2025-06-24 02:42:58.036 E + 1.699999999999818
2025-06-24 02:42:58.041 E + 1.699999999999818
2025-06-24 02:42:58.045 E + 1.8200000000001637
2025-06-24 02:42:58.049 E + 1.7400000000002365
2025-06-24 02:42:58.054 E + 1.6900000000000546
2025-06-24 02:42:58.058 E + 1.6900000000000546
2025-06-24 02:42:58.062 E + 1.7300000000000182
2025-06-24 02:42:58.066 E + 1.75
2025-06-24 02:42:58.070 E + 1.7200000000002547
2025-06-24 02:42:58.075 E + 1.7599999999997635
2025-06-24 02:42:58.079 E + 1.6900000000000546
2025-06-24 02:42:58.083
2025-06-24 02:42:58.087 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-24 02:42:58.092 ---------------------------- Captured stdout setup -----------------------------
2025-06-24 02:42:58.096 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.85714, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.34999999999990905
E + 0.34999999999990905
E + 0.3400000000001455
E + 0.36999999999989086
E + 0.3700000000003456
E + 0.3500000000003638
E + 0.3400000000001455
E + 0.38999999999987267
E + 0.36999999999989086
E + 0.36000000000012733
E + 0.3400000000001455
E + 0.3400000000001455
E + 0.44000000000005457
E + 0.34999999999990905
E + 0.33999999999969077
E + 0.3400000000001455
E + 0.34999999999990905
E + 0.36000000000012733
E + 0.33999999999969077
E + 0.32999999999992724
E + 0.3400000000001455
E + sp_name='udr_call':
E + 1.6900000000000546
E + 1.7100000000000364
E + 1.7399999999997817
E + 1.6900000000000546
E + 1.6899999999995998
E + 1.6499999999996362
E + 1.7100000000000364
E + 1.680000000000291
E + 1.6900000000000546
E + 1.6499999999996362
E + 1.699999999999818
E + 1.699999999999818
E + 1.8200000000001637
E + 1.7400000000002365
E + 1.6900000000000546
E + 1.6900000000000546
E + 1.7300000000000182
E + 1.75
E + 1.7200000000002547
E + 1.7599999999997635
E + 1.6900000000000546
tests/bugs/gh_7989_test.py:152: AssertionError
|