2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.61111, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.37
+ 0.3700000000000001
+ 0.3600000000000003
+ 0.35000000000000053
+ 0.45000000000000107
+ 0.35999999999999943
+ 0.39000000000000057
+ 0.33999999999999986
+ 0.46000000000000085
+ 0.46000000000000085
+ 0.360000000000003
+ 0.34999999999999787
+ 0.3500000000000014
+ 0.35999999999999943
+ 0.360000000000003
+ 0.370000000000001
+ 0.35999999999999943
+ 0.37000000000000455
+ 0.3500000000000014
+ 0.37999999999999545
+ 0.35999999999999943
+ sp_name='udr_call':
+ 1.6700000000000002
+ 1.6499999999999995
+ 1.7199999999999998
+ 1.8199999999999994
+ 1.6799999999999997
+ 1.6099999999999994
+ 1.75
+ 1.6499999999999986
+ 1.6099999999999994
+ 1.629999999999999
+ 1.6600000000000001
+ 1.7100000000000009
+ 1.6199999999999974
+ 1.6600000000000001
+ 1.639999999999997
+ 1.6199999999999974
+ 1.6700000000000017
+ 1.7199999999999989
+ 1.6499999999999986
+ 1.6200000000000045
+ 1.6700000000000017
LOG DETAILS:
2025-07-01 05:54:28.040
2025-07-01 05:54:28.047 act = <firebird.qa.plugin.Action object at [hex]>
2025-07-01 05:54:28.057 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-07-01 05:54:28.066
2025-07-01 05:54:28.075 @pytest.mark.version('>=6.0')
2025-07-01 05:54:28.086 def test_1(act: Action, capsys):
2025-07-01 05:54:28.094
2025-07-01 05:54:28.100 with act.db.connect() as con:
2025-07-01 05:54:28.105 cur=con.cursor()
2025-07-01 05:54:28.110 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-07-01 05:54:28.115 fb_pid = int(cur.fetchone()[0])
2025-07-01 05:54:28.126
2025-07-01 05:54:28.138 times_map = {}
2025-07-01 05:54:28.147 for i in range(0, N_MEASURES):
2025-07-01 05:54:28.156 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-01 05:54:28.163 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-07-01 05:54:28.169 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-01 05:54:28.174 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-01 05:54:28.178
2025-07-01 05:54:28.183 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-01 05:54:28.188 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-07-01 05:54:28.192 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-01 05:54:28.197 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-01 05:54:28.203
2025-07-01 05:54:28.212
2025-07-01 05:54:28.223 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-07-01 05:54:28.235 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-07-01 05:54:28.243
2025-07-01 05:54:28.251 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-07-01 05:54:28.259
2025-07-01 05:54:28.270 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-07-01 05:54:28.279 if median_ratio > MAX_RATIO:
2025-07-01 05:54:28.287 print(f'CPU times for each of {N_MEASURES} measures:')
2025-07-01 05:54:28.298 for sp_name in ('hash_eval', 'udr_call', ):
2025-07-01 05:54:28.308 print(f'{sp_name=}:')
2025-07-01 05:54:28.317 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-07-01 05:54:28.324 print(p)
2025-07-01 05:54:28.336
2025-07-01 05:54:28.344 act.expected_stdout = expected_stdout
2025-07-01 05:54:28.353 act.stdout = capsys.readouterr().out
2025-07-01 05:54:28.362 > assert act.clean_stdout == act.clean_expected_stdout
2025-07-01 05:54:28.370 E AssertionError: assert
2025-07-01 05:54:28.379 E - Medians ratio: acceptable
2025-07-01 05:54:28.390 E + Medians ratio: /* perf_issue_tag */ POOR: 4.61111, more than threshold: 0.4
2025-07-01 05:54:28.398 E + CPU times for each of 21 measures:
2025-07-01 05:54:28.406 E + sp_name='hash_eval':
2025-07-01 05:54:28.418 E + 0.37
2025-07-01 05:54:28.429 E + 0.3700000000000001
2025-07-01 05:54:28.440 E + 0.3600000000000003
2025-07-01 05:54:28.449 E + 0.35000000000000053
2025-07-01 05:54:28.456 E + 0.45000000000000107
2025-07-01 05:54:28.463 E + 0.35999999999999943
2025-07-01 05:54:28.469 E + 0.39000000000000057
2025-07-01 05:54:28.474 E + 0.33999999999999986
2025-07-01 05:54:28.480 E + 0.46000000000000085
2025-07-01 05:54:28.485 E + 0.46000000000000085
2025-07-01 05:54:28.491 E + 0.360000000000003
2025-07-01 05:54:28.497 E + 0.34999999999999787
2025-07-01 05:54:28.502 E + 0.3500000000000014
2025-07-01 05:54:28.513 E + 0.35999999999999943
2025-07-01 05:54:28.522 E + 0.360000000000003
2025-07-01 05:54:28.529 E + 0.370000000000001
2025-07-01 05:54:28.536 E + 0.35999999999999943
2025-07-01 05:54:28.542 E + 0.37000000000000455
2025-07-01 05:54:28.548 E + 0.3500000000000014
2025-07-01 05:54:28.555 E + 0.37999999999999545
2025-07-01 05:54:28.560 E + 0.35999999999999943
2025-07-01 05:54:28.566 E + sp_name='udr_call':
2025-07-01 05:54:28.572 E + 1.6700000000000002
2025-07-01 05:54:28.577 E + 1.6499999999999995
2025-07-01 05:54:28.583 E + 1.7199999999999998
2025-07-01 05:54:28.589 E + 1.8199999999999994
2025-07-01 05:54:28.594 E + 1.6799999999999997
2025-07-01 05:54:28.599 E + 1.6099999999999994
2025-07-01 05:54:28.604 E + 1.75
2025-07-01 05:54:28.610 E + 1.6499999999999986
2025-07-01 05:54:28.616 E + 1.6099999999999994
2025-07-01 05:54:28.622 E + 1.629999999999999
2025-07-01 05:54:28.628 E + 1.6600000000000001
2025-07-01 05:54:28.633 E + 1.7100000000000009
2025-07-01 05:54:28.639 E + 1.6199999999999974
2025-07-01 05:54:28.645 E + 1.6600000000000001
2025-07-01 05:54:28.651 E + 1.639999999999997
2025-07-01 05:54:28.657 E + 1.6199999999999974
2025-07-01 05:54:28.669 E + 1.6700000000000017
2025-07-01 05:54:28.680 E + 1.7199999999999989
2025-07-01 05:54:28.692 E + 1.6499999999999986
2025-07-01 05:54:28.702 E + 1.6200000000000045
2025-07-01 05:54:28.713 E + 1.6700000000000017
2025-07-01 05:54:28.723
2025-07-01 05:54:28.732 tests/bugs/gh_7989_test.py:152: AssertionError
2025-07-01 05:54:28.740 ---------------------------- Captured stdout setup -----------------------------
2025-07-01 05:54:28.747 Creating db: localhost:/var/tmp/qa_2024/test_11662/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.61111, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.37
E + 0.3700000000000001
E + 0.3600000000000003
E + 0.35000000000000053
E + 0.45000000000000107
E + 0.35999999999999943
E + 0.39000000000000057
E + 0.33999999999999986
E + 0.46000000000000085
E + 0.46000000000000085
E + 0.360000000000003
E + 0.34999999999999787
E + 0.3500000000000014
E + 0.35999999999999943
E + 0.360000000000003
E + 0.370000000000001
E + 0.35999999999999943
E + 0.37000000000000455
E + 0.3500000000000014
E + 0.37999999999999545
E + 0.35999999999999943
E + sp_name='udr_call':
E + 1.6700000000000002
E + 1.6499999999999995
E + 1.7199999999999998
E + 1.8199999999999994
E + 1.6799999999999997
E + 1.6099999999999994
E + 1.75
E + 1.6499999999999986
E + 1.6099999999999994
E + 1.629999999999999
E + 1.6600000000000001
E + 1.7100000000000009
E + 1.6199999999999974
E + 1.6600000000000001
E + 1.639999999999997
E + 1.6199999999999974
E + 1.6700000000000017
E + 1.7199999999999989
E + 1.6499999999999986
E + 1.6200000000000045
E + 1.6700000000000017
tests/bugs/gh_7989_test.py:152: AssertionError
|