2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.47368, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.37
+ 0.3799999999999999
+ 0.3799999999999999
+ 0.3799999999999999
+ 0.3699999999999992
+ 0.35999999999999943
+ 0.370000000000001
+ 0.4399999999999995
+ 0.370000000000001
+ 0.33999999999999986
+ 0.370000000000001
+ 0.379999999999999
+ 0.41000000000000014
+ 0.35999999999999943
+ 0.3500000000000014
+ 0.35999999999999943
+ 0.38000000000000256
+ 0.39000000000000057
+ 0.38000000000000256
+ 0.38000000000000256
+ 0.39000000000000057
+ sp_name='udr_call':
+ 1.6900000000000002
+ 1.6300000000000003
+ 1.7400000000000002
+ 1.7000000000000002
+ 1.8100000000000005
+ 1.7400000000000002
+ 1.6799999999999997
+ 1.8100000000000005
+ 1.6999999999999993
+ 1.759999999999998
+ 1.6799999999999997
+ 1.7000000000000028
+ 1.6799999999999997
+ 1.6899999999999977
+ 1.6799999999999997
+ 1.6499999999999986
+ 1.7100000000000009
+ 1.8299999999999983
+ 1.6599999999999966
+ 1.7299999999999969
+ 1.740000000000002
LOG DETAILS:
2025-06-14 05:45:04.197
2025-06-14 05:45:04.209 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-14 05:45:04.219 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-14 05:45:04.232
2025-06-14 05:45:04.245 @pytest.mark.version('>=6.0')
2025-06-14 05:45:04.260 def test_1(act: Action, capsys):
2025-06-14 05:45:04.273
2025-06-14 05:45:04.284 with act.db.connect() as con:
2025-06-14 05:45:04.297 cur=con.cursor()
2025-06-14 05:45:04.308 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-14 05:45:04.317 fb_pid = int(cur.fetchone()[0])
2025-06-14 05:45:04.324
2025-06-14 05:45:04.331 times_map = {}
2025-06-14 05:45:04.341 for i in range(0, N_MEASURES):
2025-06-14 05:45:04.354 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-14 05:45:04.364 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-14 05:45:04.376 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-14 05:45:04.389 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-14 05:45:04.402
2025-06-14 05:45:04.415 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-14 05:45:04.429 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-14 05:45:04.439 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-14 05:45:04.448 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-14 05:45:04.454
2025-06-14 05:45:04.465
2025-06-14 05:45:04.474 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-14 05:45:04.483 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-14 05:45:04.492
2025-06-14 05:45:04.501 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-14 05:45:04.508
2025-06-14 05:45:04.515 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-14 05:45:04.525 if median_ratio > MAX_RATIO:
2025-06-14 05:45:04.538 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-14 05:45:04.550 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-14 05:45:04.563 print(f'{sp_name=}:')
2025-06-14 05:45:04.572 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-14 05:45:04.583 print(p)
2025-06-14 05:45:04.592
2025-06-14 05:45:04.599 act.expected_stdout = expected_stdout
2025-06-14 05:45:04.605 act.stdout = capsys.readouterr().out
2025-06-14 05:45:04.611 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-14 05:45:04.618 E AssertionError: assert
2025-06-14 05:45:04.624 E - Medians ratio: acceptable
2025-06-14 05:45:04.631 E + Medians ratio: /* perf_issue_tag */ POOR: 4.47368, more than threshold: 0.4
2025-06-14 05:45:04.637 E + CPU times for each of 21 measures:
2025-06-14 05:45:04.644 E + sp_name='hash_eval':
2025-06-14 05:45:04.650 E + 0.37
2025-06-14 05:45:04.657 E + 0.3799999999999999
2025-06-14 05:45:04.663 E + 0.3799999999999999
2025-06-14 05:45:04.672 E + 0.3799999999999999
2025-06-14 05:45:04.683 E + 0.3699999999999992
2025-06-14 05:45:04.690 E + 0.35999999999999943
2025-06-14 05:45:04.702 E + 0.370000000000001
2025-06-14 05:45:04.710 E + 0.4399999999999995
2025-06-14 05:45:04.718 E + 0.370000000000001
2025-06-14 05:45:04.727 E + 0.33999999999999986
2025-06-14 05:45:04.738 E + 0.370000000000001
2025-06-14 05:45:04.746 E + 0.379999999999999
2025-06-14 05:45:04.754 E + 0.41000000000000014
2025-06-14 05:45:04.761 E + 0.35999999999999943
2025-06-14 05:45:04.772 E + 0.3500000000000014
2025-06-14 05:45:04.783 E + 0.35999999999999943
2025-06-14 05:45:04.791 E + 0.38000000000000256
2025-06-14 05:45:04.797 E + 0.39000000000000057
2025-06-14 05:45:04.803 E + 0.38000000000000256
2025-06-14 05:45:04.810 E + 0.38000000000000256
2025-06-14 05:45:04.822 E + 0.39000000000000057
2025-06-14 05:45:04.832 E + sp_name='udr_call':
2025-06-14 05:45:04.844 E + 1.6900000000000002
2025-06-14 05:45:04.855 E + 1.6300000000000003
2025-06-14 05:45:04.865 E + 1.7400000000000002
2025-06-14 05:45:04.875 E + 1.7000000000000002
2025-06-14 05:45:04.888 E + 1.8100000000000005
2025-06-14 05:45:04.901 E + 1.7400000000000002
2025-06-14 05:45:04.912 E + 1.6799999999999997
2025-06-14 05:45:04.921 E + 1.8100000000000005
2025-06-14 05:45:04.933 E + 1.6999999999999993
2025-06-14 05:45:04.944 E + 1.759999999999998
2025-06-14 05:45:04.953 E + 1.6799999999999997
2025-06-14 05:45:04.966 E + 1.7000000000000028
2025-06-14 05:45:04.977 E + 1.6799999999999997
2025-06-14 05:45:04.990 E + 1.6899999999999977
2025-06-14 05:45:05.002 E + 1.6799999999999997
2025-06-14 05:45:05.012 E + 1.6499999999999986
2025-06-14 05:45:05.020 E + 1.7100000000000009
2025-06-14 05:45:05.028 E + 1.8299999999999983
2025-06-14 05:45:05.038 E + 1.6599999999999966
2025-06-14 05:45:05.043 E + 1.7299999999999969
2025-06-14 05:45:05.049 E + 1.740000000000002
2025-06-14 05:45:05.059
2025-06-14 05:45:05.071 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-14 05:45:05.080 ---------------------------- Captured stdout setup -----------------------------
2025-06-14 05:45:05.094 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.47368, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.37
E + 0.3799999999999999
E + 0.3799999999999999
E + 0.3799999999999999
E + 0.3699999999999992
E + 0.35999999999999943
E + 0.370000000000001
E + 0.4399999999999995
E + 0.370000000000001
E + 0.33999999999999986
E + 0.370000000000001
E + 0.379999999999999
E + 0.41000000000000014
E + 0.35999999999999943
E + 0.3500000000000014
E + 0.35999999999999943
E + 0.38000000000000256
E + 0.39000000000000057
E + 0.38000000000000256
E + 0.38000000000000256
E + 0.39000000000000057
E + sp_name='udr_call':
E + 1.6900000000000002
E + 1.6300000000000003
E + 1.7400000000000002
E + 1.7000000000000002
E + 1.8100000000000005
E + 1.7400000000000002
E + 1.6799999999999997
E + 1.8100000000000005
E + 1.6999999999999993
E + 1.759999999999998
E + 1.6799999999999997
E + 1.7000000000000028
E + 1.6799999999999997
E + 1.6899999999999977
E + 1.6799999999999997
E + 1.6499999999999986
E + 1.7100000000000009
E + 1.8299999999999983
E + 1.6599999999999966
E + 1.7299999999999969
E + 1.740000000000002
tests/bugs/gh_7989_test.py:152: AssertionError
|