2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.66667, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.35
+ 0.3599999999999999
+ 0.34999999999999964
+ 0.34999999999999964
+ 0.370000000000001
+ 0.35999999999999943
+ 0.3800000000000008
+ 0.35999999999999943
+ 0.46000000000000085
+ 0.34999999999999787
+ 0.370000000000001
+ 0.33999999999999986
+ 0.3500000000000014
+ 0.33999999999999986
+ 0.33999999999999986
+ 0.41000000000000014
+ 0.37000000000000455
+ 0.37000000000000455
+ 0.3500000000000014
+ 0.35999999999999943
+ 0.35999999999999943
+ sp_name='udr_call':
+ 1.6500000000000001
+ 1.7300000000000004
+ 1.67
+ 1.6600000000000001
+ 1.6799999999999997
+ 1.6799999999999997
+ 1.7699999999999996
+ 1.7200000000000006
+ 1.7300000000000004
+ 1.6000000000000014
+ 1.7899999999999991
+ 1.6899999999999977
+ 1.7199999999999989
+ 1.6700000000000017
+ 1.7199999999999989
+ 1.6699999999999982
+ 1.6599999999999966
+ 1.7099999999999937
+ 1.75
+ 1.6799999999999997
+ 1.6500000000000057
LOG DETAILS:
2025-06-28 05:16:46.799
2025-06-28 05:16:46.806 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-28 05:16:46.813 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-28 05:16:46.819
2025-06-28 05:16:46.826 @pytest.mark.version('>=6.0')
2025-06-28 05:16:46.834 def test_1(act: Action, capsys):
2025-06-28 05:16:46.841
2025-06-28 05:16:46.848 with act.db.connect() as con:
2025-06-28 05:16:46.855 cur=con.cursor()
2025-06-28 05:16:46.862 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-28 05:16:46.873 fb_pid = int(cur.fetchone()[0])
2025-06-28 05:16:46.882
2025-06-28 05:16:46.890 times_map = {}
2025-06-28 05:16:46.898 for i in range(0, N_MEASURES):
2025-06-28 05:16:46.904 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-28 05:16:46.910 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-28 05:16:46.919 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-28 05:16:46.931 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-28 05:16:46.940
2025-06-28 05:16:46.946 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-28 05:16:46.951 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-28 05:16:46.957 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-28 05:16:46.963 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-28 05:16:46.969
2025-06-28 05:16:46.975
2025-06-28 05:16:46.981 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-28 05:16:46.988 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-28 05:16:46.996
2025-06-28 05:16:47.004 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-28 05:16:47.012
2025-06-28 05:16:47.020 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-28 05:16:47.027 if median_ratio > MAX_RATIO:
2025-06-28 05:16:47.035 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-28 05:16:47.042 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-28 05:16:47.051 print(f'{sp_name=}:')
2025-06-28 05:16:47.058 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-28 05:16:47.065 print(p)
2025-06-28 05:16:47.071
2025-06-28 05:16:47.077 act.expected_stdout = expected_stdout
2025-06-28 05:16:47.084 act.stdout = capsys.readouterr().out
2025-06-28 05:16:47.090 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-28 05:16:47.097 E AssertionError: assert
2025-06-28 05:16:47.104 E - Medians ratio: acceptable
2025-06-28 05:16:47.111 E + Medians ratio: /* perf_issue_tag */ POOR: 4.66667, more than threshold: 0.4
2025-06-28 05:16:47.119 E + CPU times for each of 21 measures:
2025-06-28 05:16:47.127 E + sp_name='hash_eval':
2025-06-28 05:16:47.136 E + 0.35
2025-06-28 05:16:47.149 E + 0.3599999999999999
2025-06-28 05:16:47.160 E + 0.34999999999999964
2025-06-28 05:16:47.174 E + 0.34999999999999964
2025-06-28 05:16:47.184 E + 0.370000000000001
2025-06-28 05:16:47.192 E + 0.35999999999999943
2025-06-28 05:16:47.205 E + 0.3800000000000008
2025-06-28 05:16:47.216 E + 0.35999999999999943
2025-06-28 05:16:47.226 E + 0.46000000000000085
2025-06-28 05:16:47.238 E + 0.34999999999999787
2025-06-28 05:16:47.248 E + 0.370000000000001
2025-06-28 05:16:47.256 E + 0.33999999999999986
2025-06-28 05:16:47.264 E + 0.3500000000000014
2025-06-28 05:16:47.276 E + 0.33999999999999986
2025-06-28 05:16:47.285 E + 0.33999999999999986
2025-06-28 05:16:47.296 E + 0.41000000000000014
2025-06-28 05:16:47.306 E + 0.37000000000000455
2025-06-28 05:16:47.312 E + 0.37000000000000455
2025-06-28 05:16:47.321 E + 0.3500000000000014
2025-06-28 05:16:47.331 E + 0.35999999999999943
2025-06-28 05:16:47.338 E + 0.35999999999999943
2025-06-28 05:16:47.346 E + sp_name='udr_call':
2025-06-28 05:16:47.358 E + 1.6500000000000001
2025-06-28 05:16:47.369 E + 1.7300000000000004
2025-06-28 05:16:47.377 E + 1.67
2025-06-28 05:16:47.383 E + 1.6600000000000001
2025-06-28 05:16:47.390 E + 1.6799999999999997
2025-06-28 05:16:47.401 E + 1.6799999999999997
2025-06-28 05:16:47.414 E + 1.7699999999999996
2025-06-28 05:16:47.425 E + 1.7200000000000006
2025-06-28 05:16:47.433 E + 1.7300000000000004
2025-06-28 05:16:47.440 E + 1.6000000000000014
2025-06-28 05:16:47.446 E + 1.7899999999999991
2025-06-28 05:16:47.452 E + 1.6899999999999977
2025-06-28 05:16:47.457 E + 1.7199999999999989
2025-06-28 05:16:47.470 E + 1.6700000000000017
2025-06-28 05:16:47.480 E + 1.7199999999999989
2025-06-28 05:16:47.488 E + 1.6699999999999982
2025-06-28 05:16:47.501 E + 1.6599999999999966
2025-06-28 05:16:47.511 E + 1.7099999999999937
2025-06-28 05:16:47.520 E + 1.75
2025-06-28 05:16:47.531 E + 1.6799999999999997
2025-06-28 05:16:47.539 E + 1.6500000000000057
2025-06-28 05:16:47.548
2025-06-28 05:16:47.559 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-28 05:16:47.571 ---------------------------- Captured stdout setup -----------------------------
2025-06-28 05:16:47.582 Creating db: localhost:/var/tmp/qa_2024/test_11657/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.66667, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.35
E + 0.3599999999999999
E + 0.34999999999999964
E + 0.34999999999999964
E + 0.370000000000001
E + 0.35999999999999943
E + 0.3800000000000008
E + 0.35999999999999943
E + 0.46000000000000085
E + 0.34999999999999787
E + 0.370000000000001
E + 0.33999999999999986
E + 0.3500000000000014
E + 0.33999999999999986
E + 0.33999999999999986
E + 0.41000000000000014
E + 0.37000000000000455
E + 0.37000000000000455
E + 0.3500000000000014
E + 0.35999999999999943
E + 0.35999999999999943
E + sp_name='udr_call':
E + 1.6500000000000001
E + 1.7300000000000004
E + 1.67
E + 1.6600000000000001
E + 1.6799999999999997
E + 1.6799999999999997
E + 1.7699999999999996
E + 1.7200000000000006
E + 1.7300000000000004
E + 1.6000000000000014
E + 1.7899999999999991
E + 1.6899999999999977
E + 1.7199999999999989
E + 1.6700000000000017
E + 1.7199999999999989
E + 1.6699999999999982
E + 1.6599999999999966
E + 1.7099999999999937
E + 1.75
E + 1.6799999999999997
E + 1.6500000000000057
tests/bugs/gh_7989_test.py:152: AssertionError
|