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.59
+ 0.3400000000000003
+ 0.34999999999999964
+ 0.39000000000000057
+ 0.379999999999999
+ 0.3600000000000012
+ 0.370000000000001
+ 0.370000000000001
+ 0.360000000000003
+ 0.379999999999999
+ 0.379999999999999
+ 0.35999999999999943
+ 0.370000000000001
+ 0.39000000000000057
+ 0.36999999999999744
+ 0.350000000000005
+ 0.36999999999999744
+ 0.35999999999999943
+ 0.3499999999999943
+ 0.3499999999999943
+ 0.36999999999999744
+ sp_name='udr_call':
+ 1.7199999999999998
+ 1.8399999999999999
+ 1.7000000000000002
+ 1.67
+ 1.9900000000000002
+ 1.7199999999999989
+ 1.709999999999999
+ 1.759999999999998
+ 1.8999999999999986
+ 1.6600000000000001
+ 1.6800000000000033
+ 1.7099999999999973
+ 1.6700000000000017
+ 1.75
+ 1.6999999999999993
+ 1.6499999999999986
+ 1.6700000000000017
+ 1.6700000000000017
+ 1.6500000000000057
+ 1.6900000000000048
+ 1.7100000000000009
LOG DETAILS:
2025-06-18 05:38:32.064
2025-06-18 05:38:32.072 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-18 05:38:32.078 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-18 05:38:32.083
2025-06-18 05:38:32.089 @pytest.mark.version('>=6.0')
2025-06-18 05:38:32.095 def test_1(act: Action, capsys):
2025-06-18 05:38:32.102
2025-06-18 05:38:32.111 with act.db.connect() as con:
2025-06-18 05:38:32.118 cur=con.cursor()
2025-06-18 05:38:32.124 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-18 05:38:32.129 fb_pid = int(cur.fetchone()[0])
2025-06-18 05:38:32.134
2025-06-18 05:38:32.139 times_map = {}
2025-06-18 05:38:32.145 for i in range(0, N_MEASURES):
2025-06-18 05:38:32.151 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-18 05:38:32.159 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-18 05:38:32.167 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-18 05:38:32.173 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-18 05:38:32.177
2025-06-18 05:38:32.182 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-18 05:38:32.187 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-18 05:38:32.192 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-18 05:38:32.196 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-18 05:38:32.201
2025-06-18 05:38:32.205
2025-06-18 05:38:32.210 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-18 05:38:32.221 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-18 05:38:32.234
2025-06-18 05:38:32.244 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-18 05:38:32.253
2025-06-18 05:38:32.262 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-18 05:38:32.268 if median_ratio > MAX_RATIO:
2025-06-18 05:38:32.273 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-18 05:38:32.280 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-18 05:38:32.288 print(f'{sp_name=}:')
2025-06-18 05:38:32.295 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-18 05:38:32.300 print(p)
2025-06-18 05:38:32.305
2025-06-18 05:38:32.310 act.expected_stdout = expected_stdout
2025-06-18 05:38:32.317 act.stdout = capsys.readouterr().out
2025-06-18 05:38:32.324 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-18 05:38:32.332 E AssertionError: assert
2025-06-18 05:38:32.339 E - Medians ratio: acceptable
2025-06-18 05:38:32.346 E + Medians ratio: /* perf_issue_tag */ POOR: 4.59459, more than threshold: 0.4
2025-06-18 05:38:32.356 E + CPU times for each of 21 measures:
2025-06-18 05:38:32.366 E + sp_name='hash_eval':
2025-06-18 05:38:32.374 E + 0.59
2025-06-18 05:38:32.383 E + 0.3400000000000003
2025-06-18 05:38:32.394 E + 0.34999999999999964
2025-06-18 05:38:32.406 E + 0.39000000000000057
2025-06-18 05:38:32.414 E + 0.379999999999999
2025-06-18 05:38:32.423 E + 0.3600000000000012
2025-06-18 05:38:32.434 E + 0.370000000000001
2025-06-18 05:38:32.442 E + 0.370000000000001
2025-06-18 05:38:32.450 E + 0.360000000000003
2025-06-18 05:38:32.461 E + 0.379999999999999
2025-06-18 05:38:32.471 E + 0.379999999999999
2025-06-18 05:38:32.478 E + 0.35999999999999943
2025-06-18 05:38:32.484 E + 0.370000000000001
2025-06-18 05:38:32.489 E + 0.39000000000000057
2025-06-18 05:38:32.495 E + 0.36999999999999744
2025-06-18 05:38:32.501 E + 0.350000000000005
2025-06-18 05:38:32.508 E + 0.36999999999999744
2025-06-18 05:38:32.515 E + 0.35999999999999943
2025-06-18 05:38:32.522 E + 0.3499999999999943
2025-06-18 05:38:32.528 E + 0.3499999999999943
2025-06-18 05:38:32.533 E + 0.36999999999999744
2025-06-18 05:38:32.539 E + sp_name='udr_call':
2025-06-18 05:38:32.544 E + 1.7199999999999998
2025-06-18 05:38:32.550 E + 1.8399999999999999
2025-06-18 05:38:32.561 E + 1.7000000000000002
2025-06-18 05:38:32.570 E + 1.67
2025-06-18 05:38:32.579 E + 1.9900000000000002
2025-06-18 05:38:32.586 E + 1.7199999999999989
2025-06-18 05:38:32.592 E + 1.709999999999999
2025-06-18 05:38:32.605 E + 1.759999999999998
2025-06-18 05:38:32.614 E + 1.8999999999999986
2025-06-18 05:38:32.623 E + 1.6600000000000001
2025-06-18 05:38:32.630 E + 1.6800000000000033
2025-06-18 05:38:32.641 E + 1.7099999999999973
2025-06-18 05:38:32.652 E + 1.6700000000000017
2025-06-18 05:38:32.660 E + 1.75
2025-06-18 05:38:32.669 E + 1.6999999999999993
2025-06-18 05:38:32.682 E + 1.6499999999999986
2025-06-18 05:38:32.695 E + 1.6700000000000017
2025-06-18 05:38:32.706 E + 1.6700000000000017
2025-06-18 05:38:32.718 E + 1.6500000000000057
2025-06-18 05:38:32.732 E + 1.6900000000000048
2025-06-18 05:38:32.745 E + 1.7100000000000009
2025-06-18 05:38:32.755
2025-06-18 05:38:32.763 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-18 05:38:32.771 ---------------------------- Captured stdout setup -----------------------------
2025-06-18 05:38:32.781 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.59
E + 0.3400000000000003
E + 0.34999999999999964
E + 0.39000000000000057
E + 0.379999999999999
E + 0.3600000000000012
E + 0.370000000000001
E + 0.370000000000001
E + 0.360000000000003
E + 0.379999999999999
E + 0.379999999999999
E + 0.35999999999999943
E + 0.370000000000001
E + 0.39000000000000057
E + 0.36999999999999744
E + 0.350000000000005
E + 0.36999999999999744
E + 0.35999999999999943
E + 0.3499999999999943
E + 0.3499999999999943
E + 0.36999999999999744
E + sp_name='udr_call':
E + 1.7199999999999998
E + 1.8399999999999999
E + 1.7000000000000002
E + 1.67
E + 1.9900000000000002
E + 1.7199999999999989
E + 1.709999999999999
E + 1.759999999999998
E + 1.8999999999999986
E + 1.6600000000000001
E + 1.6800000000000033
E + 1.7099999999999973
E + 1.6700000000000017
E + 1.75
E + 1.6999999999999993
E + 1.6499999999999986
E + 1.6700000000000017
E + 1.6700000000000017
E + 1.6500000000000057
E + 1.6900000000000048
E + 1.7100000000000009
tests/bugs/gh_7989_test.py:152: AssertionError
|