2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.6875, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.25
+ 0.25
+ 0.25
+ 0.28125
+ 0.25
+ 0.25
+ 0.265625
+ 0.265625
+ 0.25
+ 0.25
+ 0.25
+ 0.25
+ 0.25
+ 0.265625
+ 0.25
+ 0.265625
+ 0.265625
+ 0.265625
+ 0.25
+ 0.265625
+ 0.25
+ sp_name='udr_call':
+ 1.171875
+ 1.171875
+ 1.171875
+ 1.1875
+ 1.1875
+ 1.171875
+ 1.15625
+ 1.171875
+ 1.171875
+ 1.171875
+ 1.171875
+ 1.1875
+ 1.171875
+ 1.171875
+ 1.171875
+ 1.15625
+ 1.15625
+ 1.15625
+ 1.171875
+ 1.171875
+ 1.15625
LOG DETAILS:
2025-06-14 04:53:35.889
2025-06-14 04:53:35.890 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-14 04:53:35.890 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-14 04:53:35.890
2025-06-14 04:53:35.890 @pytest.mark.version('>=6.0')
2025-06-14 04:53:35.890 def test_1(act: Action, capsys):
2025-06-14 04:53:35.890
2025-06-14 04:53:35.890 with act.db.connect() as con:
2025-06-14 04:53:35.890 cur=con.cursor()
2025-06-14 04:53:35.890 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-14 04:53:35.890 fb_pid = int(cur.fetchone()[0])
2025-06-14 04:53:35.890
2025-06-14 04:53:35.890 times_map = {}
2025-06-14 04:53:35.890 for i in range(0, N_MEASURES):
2025-06-14 04:53:35.890 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-14 04:53:35.890 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-14 04:53:35.890 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-14 04:53:35.890 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-14 04:53:35.890
2025-06-14 04:53:35.890 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-14 04:53:35.891 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-14 04:53:35.891 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-14 04:53:35.891 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-14 04:53:35.891
2025-06-14 04:53:35.891
2025-06-14 04:53:35.891 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-14 04:53:35.891 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-14 04:53:35.891
2025-06-14 04:53:35.891 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-14 04:53:35.891
2025-06-14 04:53:35.891 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-14 04:53:35.891 if median_ratio > MAX_RATIO:
2025-06-14 04:53:35.891 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-14 04:53:35.891 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-14 04:53:35.891 print(f'{sp_name=}:')
2025-06-14 04:53:35.891 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-14 04:53:35.891 print(p)
2025-06-14 04:53:35.891
2025-06-14 04:53:35.892 act.expected_stdout = expected_stdout
2025-06-14 04:53:35.892 act.stdout = capsys.readouterr().out
2025-06-14 04:53:35.892 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-14 04:53:35.892 E AssertionError: assert
2025-06-14 04:53:35.892 E - Medians ratio: acceptable
2025-06-14 04:53:35.892 E + Medians ratio: /* perf_issue_tag */ POOR: 4.6875, more than threshold: 0.4
2025-06-14 04:53:35.892 E + CPU times for each of 21 measures:
2025-06-14 04:53:35.892 E + sp_name='hash_eval':
2025-06-14 04:53:35.892 E + 0.25
2025-06-14 04:53:35.892 E + 0.25
2025-06-14 04:53:35.892 E + 0.25
2025-06-14 04:53:35.892 E + 0.28125
2025-06-14 04:53:35.892 E + 0.25
2025-06-14 04:53:35.892 E + 0.25
2025-06-14 04:53:35.892 E + 0.265625
2025-06-14 04:53:35.892 E + 0.265625
2025-06-14 04:53:35.892 E + 0.25
2025-06-14 04:53:35.892 E + 0.25
2025-06-14 04:53:35.893 E + 0.25
2025-06-14 04:53:35.893 E + 0.25
2025-06-14 04:53:35.893 E + 0.25
2025-06-14 04:53:35.893 E + 0.265625
2025-06-14 04:53:35.893 E + 0.25
2025-06-14 04:53:35.893 E + 0.265625
2025-06-14 04:53:35.893 E + 0.265625
2025-06-14 04:53:35.893 E + 0.265625
2025-06-14 04:53:35.893 E + 0.25
2025-06-14 04:53:35.893 E + 0.265625
2025-06-14 04:53:35.893 E + 0.25
2025-06-14 04:53:35.893 E + sp_name='udr_call':
2025-06-14 04:53:35.893 E + 1.171875
2025-06-14 04:53:35.893 E + 1.171875
2025-06-14 04:53:35.893 E + 1.171875
2025-06-14 04:53:35.893 E + 1.1875
2025-06-14 04:53:35.893 E + 1.1875
2025-06-14 04:53:35.893 E + 1.171875
2025-06-14 04:53:35.893 E + 1.15625
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.1875
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.15625
2025-06-14 04:53:35.894 E + 1.15625
2025-06-14 04:53:35.894 E + 1.15625
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.171875
2025-06-14 04:53:35.894 E + 1.15625
2025-06-14 04:53:35.894
2025-06-14 04:53:35.894 tests\bugs\gh_7989_test.py:152: AssertionError
2025-06-14 04:53:35.894 ---------------------------- Captured stdout setup ----------------------------
2025-06-14 04:53:35.894 Creating db: localhost:H:\QA\temp\qa2024.tmp\fbqa\test_11676\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.6875, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.25
E + 0.25
E + 0.25
E + 0.28125
E + 0.25
E + 0.25
E + 0.265625
E + 0.265625
E + 0.25
E + 0.25
E + 0.25
E + 0.25
E + 0.25
E + 0.265625
E + 0.25
E + 0.265625
E + 0.265625
E + 0.265625
E + 0.25
E + 0.265625
E + 0.25
E + sp_name='udr_call':
E + 1.171875
E + 1.171875
E + 1.171875
E + 1.1875
E + 1.1875
E + 1.171875
E + 1.15625
E + 1.171875
E + 1.171875
E + 1.171875
E + 1.171875
E + 1.1875
E + 1.171875
E + 1.171875
E + 1.171875
E + 1.15625
E + 1.15625
E + 1.15625
E + 1.171875
E + 1.171875
E + 1.15625
tests\bugs\gh_7989_test.py:152: AssertionError
|