2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.59459, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.38
+ 0.3500000000000001
+ 0.3899999999999997
+ 0.3799999999999999
+ 0.35999999999999943
+ 0.3800000000000008
+ 0.3699999999999992
+ 0.4200000000000017
+ 0.34999999999999787
+ 0.3299999999999983
+ 0.389999999999997
+ 0.36999999999999744
+ 0.33999999999999986
+ 0.45000000000000284
+ 0.3500000000000014
+ 0.33999999999999986
+ 0.39000000000000057
+ 0.35999999999999943
+ 0.36999999999999744
+ 0.3400000000000034
+ 0.35999999999999943
+ sp_name='udr_call':
+ 1.7100000000000002
+ 1.71
+ 1.6900000000000004
+ 1.6799999999999997
+ 1.67
+ 1.7300000000000004
+ 1.6899999999999995
+ 1.8900000000000006
+ 1.7600000000000016
+ 1.6500000000000021
+ 1.6300000000000026
+ 1.7900000000000027
+ 1.6899999999999977
+ 1.7299999999999969
+ 1.6999999999999993
+ 1.7100000000000009
+ 1.6499999999999986
+ 1.6600000000000037
+ 1.75
+ 1.7299999999999969
+ 1.6700000000000017
LOG DETAILS:
2025-06-19 05:39:56.288
2025-06-19 05:39:56.298 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-19 05:39:56.306 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-19 05:39:56.317
2025-06-19 05:39:56.327 @pytest.mark.version('>=6.0')
2025-06-19 05:39:56.335 def test_1(act: Action, capsys):
2025-06-19 05:39:56.342
2025-06-19 05:39:56.351 with act.db.connect() as con:
2025-06-19 05:39:56.364 cur=con.cursor()
2025-06-19 05:39:56.374 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-19 05:39:56.381 fb_pid = int(cur.fetchone()[0])
2025-06-19 05:39:56.389
2025-06-19 05:39:56.395 times_map = {}
2025-06-19 05:39:56.404 for i in range(0, N_MEASURES):
2025-06-19 05:39:56.412 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-19 05:39:56.419 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-19 05:39:56.427 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-19 05:39:56.439 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-19 05:39:56.447
2025-06-19 05:39:56.453 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-19 05:39:56.459 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-19 05:39:56.467 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-19 05:39:56.478 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-19 05:39:56.490
2025-06-19 05:39:56.501
2025-06-19 05:39:56.513 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-19 05:39:56.525 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-19 05:39:56.535
2025-06-19 05:39:56.544 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-19 05:39:56.551
2025-06-19 05:39:56.564 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-19 05:39:56.575 if median_ratio > MAX_RATIO:
2025-06-19 05:39:56.584 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-19 05:39:56.592 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-19 05:39:56.598 print(f'{sp_name=}:')
2025-06-19 05:39:56.605 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-19 05:39:56.611 print(p)
2025-06-19 05:39:56.616
2025-06-19 05:39:56.622 act.expected_stdout = expected_stdout
2025-06-19 05:39:56.628 act.stdout = capsys.readouterr().out
2025-06-19 05:39:56.634 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-19 05:39:56.640 E AssertionError: assert
2025-06-19 05:39:56.647 E - Medians ratio: acceptable
2025-06-19 05:39:56.655 E + Medians ratio: /* perf_issue_tag */ POOR: 4.59459, more than threshold: 0.4
2025-06-19 05:39:56.663 E + CPU times for each of 21 measures:
2025-06-19 05:39:56.673 E + sp_name='hash_eval':
2025-06-19 05:39:56.681 E + 0.38
2025-06-19 05:39:56.690 E + 0.3500000000000001
2025-06-19 05:39:56.698 E + 0.3899999999999997
2025-06-19 05:39:56.709 E + 0.3799999999999999
2025-06-19 05:39:56.718 E + 0.35999999999999943
2025-06-19 05:39:56.729 E + 0.3800000000000008
2025-06-19 05:39:56.738 E + 0.3699999999999992
2025-06-19 05:39:56.745 E + 0.4200000000000017
2025-06-19 05:39:56.751 E + 0.34999999999999787
2025-06-19 05:39:56.759 E + 0.3299999999999983
2025-06-19 05:39:56.771 E + 0.389999999999997
2025-06-19 05:39:56.780 E + 0.36999999999999744
2025-06-19 05:39:56.792 E + 0.33999999999999986
2025-06-19 05:39:56.801 E + 0.45000000000000284
2025-06-19 05:39:56.812 E + 0.3500000000000014
2025-06-19 05:39:56.822 E + 0.33999999999999986
2025-06-19 05:39:56.833 E + 0.39000000000000057
2025-06-19 05:39:56.844 E + 0.35999999999999943
2025-06-19 05:39:56.855 E + 0.36999999999999744
2025-06-19 05:39:56.866 E + 0.3400000000000034
2025-06-19 05:39:56.874 E + 0.35999999999999943
2025-06-19 05:39:56.882 E + sp_name='udr_call':
2025-06-19 05:39:56.890 E + 1.7100000000000002
2025-06-19 05:39:56.896 E + 1.71
2025-06-19 05:39:56.902 E + 1.6900000000000004
2025-06-19 05:39:56.908 E + 1.6799999999999997
2025-06-19 05:39:56.915 E + 1.67
2025-06-19 05:39:56.921 E + 1.7300000000000004
2025-06-19 05:39:56.927 E + 1.6899999999999995
2025-06-19 05:39:56.935 E + 1.8900000000000006
2025-06-19 05:39:56.946 E + 1.7600000000000016
2025-06-19 05:39:56.953 E + 1.6500000000000021
2025-06-19 05:39:56.960 E + 1.6300000000000026
2025-06-19 05:39:56.966 E + 1.7900000000000027
2025-06-19 05:39:56.975 E + 1.6899999999999977
2025-06-19 05:39:56.981 E + 1.7299999999999969
2025-06-19 05:39:56.990 E + 1.6999999999999993
2025-06-19 05:39:56.998 E + 1.7100000000000009
2025-06-19 05:39:57.005 E + 1.6499999999999986
2025-06-19 05:39:57.010 E + 1.6600000000000037
2025-06-19 05:39:57.015 E + 1.75
2025-06-19 05:39:57.021 E + 1.7299999999999969
2025-06-19 05:39:57.025 E + 1.6700000000000017
2025-06-19 05:39:57.030
2025-06-19 05:39:57.034 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-19 05:39:57.039 ---------------------------- Captured stdout setup -----------------------------
2025-06-19 05:39:57.043 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.59459, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.38
E + 0.3500000000000001
E + 0.3899999999999997
E + 0.3799999999999999
E + 0.35999999999999943
E + 0.3800000000000008
E + 0.3699999999999992
E + 0.4200000000000017
E + 0.34999999999999787
E + 0.3299999999999983
E + 0.389999999999997
E + 0.36999999999999744
E + 0.33999999999999986
E + 0.45000000000000284
E + 0.3500000000000014
E + 0.33999999999999986
E + 0.39000000000000057
E + 0.35999999999999943
E + 0.36999999999999744
E + 0.3400000000000034
E + 0.35999999999999943
E + sp_name='udr_call':
E + 1.7100000000000002
E + 1.71
E + 1.6900000000000004
E + 1.6799999999999997
E + 1.67
E + 1.7300000000000004
E + 1.6899999999999995
E + 1.8900000000000006
E + 1.7600000000000016
E + 1.6500000000000021
E + 1.6300000000000026
E + 1.7900000000000027
E + 1.6899999999999977
E + 1.7299999999999969
E + 1.6999999999999993
E + 1.7100000000000009
E + 1.6499999999999986
E + 1.6600000000000037
E + 1.75
E + 1.7299999999999969
E + 1.6700000000000017
tests/bugs/gh_7989_test.py:152: AssertionError
|