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.37
+ 0.3600000000000003
+ 0.34999999999999964
+ 0.34999999999999964
+ 0.379999999999999
+ 0.35999999999999943
+ 0.3699999999999992
+ 0.370000000000001
+ 0.35999999999999943
+ 0.3500000000000014
+ 0.370000000000001
+ 0.34999999999999787
+ 0.360000000000003
+ 0.41999999999999815
+ 0.33999999999999986
+ 0.35999999999999943
+ 0.36999999999999744
+ 0.36999999999999744
+ 0.3399999999999963
+ 0.35999999999999943
+ 0.36999999999999744
+ sp_name='udr_call':
+ 1.65
+ 1.71
+ 1.6500000000000004
+ 1.660000000000001
+ 1.620000000000001
+ 1.67
+ 1.7400000000000002
+ 1.620000000000001
+ 1.629999999999999
+ 1.6899999999999977
+ 1.6900000000000013
+ 1.6999999999999993
+ 1.6999999999999993
+ 1.7100000000000009
+ 1.6600000000000001
+ 1.5899999999999999
+ 1.8000000000000043
+ 1.6900000000000048
+ 1.730000000000004
+ 1.5899999999999963
+ 1.6800000000000068
LOG DETAILS:
2025-06-26 05:22:04.839
2025-06-26 05:22:04.847 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-26 05:22:04.853 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-26 05:22:04.859
2025-06-26 05:22:04.864 @pytest.mark.version('>=6.0')
2025-06-26 05:22:04.870 def test_1(act: Action, capsys):
2025-06-26 05:22:04.883
2025-06-26 05:22:04.891 with act.db.connect() as con:
2025-06-26 05:22:04.899 cur=con.cursor()
2025-06-26 05:22:04.910 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-26 05:22:04.919 fb_pid = int(cur.fetchone()[0])
2025-06-26 05:22:04.928
2025-06-26 05:22:04.937 times_map = {}
2025-06-26 05:22:04.945 for i in range(0, N_MEASURES):
2025-06-26 05:22:04.957 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-26 05:22:04.967 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-26 05:22:04.976 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-26 05:22:04.985 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-26 05:22:04.994
2025-06-26 05:22:05.008 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-26 05:22:05.021 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-26 05:22:05.035 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-26 05:22:05.046 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-26 05:22:05.055
2025-06-26 05:22:05.064
2025-06-26 05:22:05.072 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-26 05:22:05.079 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-26 05:22:05.084
2025-06-26 05:22:05.090 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-26 05:22:05.095
2025-06-26 05:22:05.101 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-26 05:22:05.108 if median_ratio > MAX_RATIO:
2025-06-26 05:22:05.114 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-26 05:22:05.120 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-26 05:22:05.125 print(f'{sp_name=}:')
2025-06-26 05:22:05.132 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-26 05:22:05.138 print(p)
2025-06-26 05:22:05.143
2025-06-26 05:22:05.151 act.expected_stdout = expected_stdout
2025-06-26 05:22:05.162 act.stdout = capsys.readouterr().out
2025-06-26 05:22:05.170 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-26 05:22:05.178 E AssertionError: assert
2025-06-26 05:22:05.186 E - Medians ratio: acceptable
2025-06-26 05:22:05.193 E + Medians ratio: /* perf_issue_tag */ POOR: 4.66667, more than threshold: 0.4
2025-06-26 05:22:05.200 E + CPU times for each of 21 measures:
2025-06-26 05:22:05.205 E + sp_name='hash_eval':
2025-06-26 05:22:05.210 E + 0.37
2025-06-26 05:22:05.216 E + 0.3600000000000003
2025-06-26 05:22:05.222 E + 0.34999999999999964
2025-06-26 05:22:05.232 E + 0.34999999999999964
2025-06-26 05:22:05.241 E + 0.379999999999999
2025-06-26 05:22:05.249 E + 0.35999999999999943
2025-06-26 05:22:05.255 E + 0.3699999999999992
2025-06-26 05:22:05.264 E + 0.370000000000001
2025-06-26 05:22:05.273 E + 0.35999999999999943
2025-06-26 05:22:05.280 E + 0.3500000000000014
2025-06-26 05:22:05.286 E + 0.370000000000001
2025-06-26 05:22:05.291 E + 0.34999999999999787
2025-06-26 05:22:05.297 E + 0.360000000000003
2025-06-26 05:22:05.302 E + 0.41999999999999815
2025-06-26 05:22:05.314 E + 0.33999999999999986
2025-06-26 05:22:05.323 E + 0.35999999999999943
2025-06-26 05:22:05.330 E + 0.36999999999999744
2025-06-26 05:22:05.336 E + 0.36999999999999744
2025-06-26 05:22:05.349 E + 0.3399999999999963
2025-06-26 05:22:05.359 E + 0.35999999999999943
2025-06-26 05:22:05.366 E + 0.36999999999999744
2025-06-26 05:22:05.374 E + sp_name='udr_call':
2025-06-26 05:22:05.386 E + 1.65
2025-06-26 05:22:05.396 E + 1.71
2025-06-26 05:22:05.404 E + 1.6500000000000004
2025-06-26 05:22:05.410 E + 1.660000000000001
2025-06-26 05:22:05.419 E + 1.620000000000001
2025-06-26 05:22:05.430 E + 1.67
2025-06-26 05:22:05.439 E + 1.7400000000000002
2025-06-26 05:22:05.451 E + 1.620000000000001
2025-06-26 05:22:05.461 E + 1.629999999999999
2025-06-26 05:22:05.473 E + 1.6899999999999977
2025-06-26 05:22:05.480 E + 1.6900000000000013
2025-06-26 05:22:05.486 E + 1.6999999999999993
2025-06-26 05:22:05.491 E + 1.6999999999999993
2025-06-26 05:22:05.496 E + 1.7100000000000009
2025-06-26 05:22:05.501 E + 1.6600000000000001
2025-06-26 05:22:05.506 E + 1.5899999999999999
2025-06-26 05:22:05.511 E + 1.8000000000000043
2025-06-26 05:22:05.516 E + 1.6900000000000048
2025-06-26 05:22:05.521 E + 1.730000000000004
2025-06-26 05:22:05.526 E + 1.5899999999999963
2025-06-26 05:22:05.530 E + 1.6800000000000068
2025-06-26 05:22:05.535
2025-06-26 05:22:05.539 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-26 05:22:05.543 ---------------------------- Captured stdout setup -----------------------------
2025-06-26 05:22:05.551 Creating db: localhost:/var/tmp/qa_2024/test_11653/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.37
E + 0.3600000000000003
E + 0.34999999999999964
E + 0.34999999999999964
E + 0.379999999999999
E + 0.35999999999999943
E + 0.3699999999999992
E + 0.370000000000001
E + 0.35999999999999943
E + 0.3500000000000014
E + 0.370000000000001
E + 0.34999999999999787
E + 0.360000000000003
E + 0.41999999999999815
E + 0.33999999999999986
E + 0.35999999999999943
E + 0.36999999999999744
E + 0.36999999999999744
E + 0.3399999999999963
E + 0.35999999999999943
E + 0.36999999999999744
E + sp_name='udr_call':
E + 1.65
E + 1.71
E + 1.6500000000000004
E + 1.660000000000001
E + 1.620000000000001
E + 1.67
E + 1.7400000000000002
E + 1.620000000000001
E + 1.629999999999999
E + 1.6899999999999977
E + 1.6900000000000013
E + 1.6999999999999993
E + 1.6999999999999993
E + 1.7100000000000009
E + 1.6600000000000001
E + 1.5899999999999999
E + 1.8000000000000043
E + 1.6900000000000048
E + 1.730000000000004
E + 1.5899999999999963
E + 1.6800000000000068
tests/bugs/gh_7989_test.py:152: AssertionError
|