2 @message |
Performance problem
AssertionError: assert
- Medians ratio: acceptable
+ Medians ratio: /* perf_issue_tag */ POOR: 4.80556, more than threshold: 0.4
+ CPU times for each of 21 measures:
+ sp_name='hash_eval':
+ 0.36
+ 0.3700000000000001
+ 0.3799999999999999
+ 0.3600000000000003
+ 0.35999999999999943
+ 0.4300000000000015
+ 0.41999999999999993
+ 0.370000000000001
+ 0.360000000000003
+ 0.370000000000001
+ 0.35999999999999943
+ 0.370000000000001
+ 0.35999999999999943
+ 0.3500000000000014
+ 0.34999999999999787
+ 0.36999999999999744
+ 0.3399999999999963
+ 0.35999999999999943
+ 0.3400000000000034
+ 0.35999999999999943
+ 0.37999999999999545
+ sp_name='udr_call':
+ 1.6999999999999997
+ 1.6900000000000004
+ 1.7299999999999995
+ 1.7600000000000007
+ 1.7899999999999991
+ 1.7399999999999984
+ 1.7400000000000002
+ 1.8499999999999979
+ 1.6899999999999977
+ 1.6799999999999997
+ 1.6999999999999993
+ 1.7300000000000004
+ 1.7300000000000004
+ 1.7300000000000004
+ 1.740000000000002
+ 1.730000000000004
+ 1.7199999999999989
+ 1.8100000000000023
+ 1.6899999999999977
+ 1.7000000000000028
+ 1.7199999999999989
LOG DETAILS:
2025-06-29 05:34:59.639
2025-06-29 05:34:59.647 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-29 05:34:59.661 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-29 05:34:59.671
2025-06-29 05:34:59.681 @pytest.mark.version('>=6.0')
2025-06-29 05:34:59.690 def test_1(act: Action, capsys):
2025-06-29 05:34:59.700
2025-06-29 05:34:59.711 with act.db.connect() as con:
2025-06-29 05:34:59.720 cur=con.cursor()
2025-06-29 05:34:59.728 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-06-29 05:34:59.735 fb_pid = int(cur.fetchone()[0])
2025-06-29 05:34:59.741
2025-06-29 05:34:59.747 times_map = {}
2025-06-29 05:34:59.755 for i in range(0, N_MEASURES):
2025-06-29 05:34:59.766 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-29 05:34:59.775 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-06-29 05:34:59.782 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-29 05:34:59.792 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-29 05:34:59.802
2025-06-29 05:34:59.811 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-06-29 05:34:59.823 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-06-29 05:34:59.832 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-06-29 05:34:59.841 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-06-29 05:34:59.848
2025-06-29 05:34:59.854
2025-06-29 05:34:59.861 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-06-29 05:34:59.875 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-06-29 05:34:59.884
2025-06-29 05:34:59.892 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-06-29 05:34:59.902
2025-06-29 05:34:59.917 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-29 05:34:59.929 if median_ratio > MAX_RATIO:
2025-06-29 05:34:59.939 print(f'CPU times for each of {N_MEASURES} measures:')
2025-06-29 05:34:59.947 for sp_name in ('hash_eval', 'udr_call', ):
2025-06-29 05:34:59.954 print(f'{sp_name=}:')
2025-06-29 05:34:59.961 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-06-29 05:34:59.973 print(p)
2025-06-29 05:34:59.983
2025-06-29 05:34:59.991 act.expected_stdout = expected_stdout
2025-06-29 05:34:59.998 act.stdout = capsys.readouterr().out
2025-06-29 05:35:00.006 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-29 05:35:00.012 E AssertionError: assert
2025-06-29 05:35:00.019 E - Medians ratio: acceptable
2025-06-29 05:35:00.026 E + Medians ratio: /* perf_issue_tag */ POOR: 4.80556, more than threshold: 0.4
2025-06-29 05:35:00.033 E + CPU times for each of 21 measures:
2025-06-29 05:35:00.039 E + sp_name='hash_eval':
2025-06-29 05:35:00.045 E + 0.36
2025-06-29 05:35:00.058 E + 0.3700000000000001
2025-06-29 05:35:00.070 E + 0.3799999999999999
2025-06-29 05:35:00.083 E + 0.3600000000000003
2025-06-29 05:35:00.097 E + 0.35999999999999943
2025-06-29 05:35:00.108 E + 0.4300000000000015
2025-06-29 05:35:00.118 E + 0.41999999999999993
2025-06-29 05:35:00.127 E + 0.370000000000001
2025-06-29 05:35:00.135 E + 0.360000000000003
2025-06-29 05:35:00.143 E + 0.370000000000001
2025-06-29 05:35:00.150 E + 0.35999999999999943
2025-06-29 05:35:00.160 E + 0.370000000000001
2025-06-29 05:35:00.170 E + 0.35999999999999943
2025-06-29 05:35:00.179 E + 0.3500000000000014
2025-06-29 05:35:00.186 E + 0.34999999999999787
2025-06-29 05:35:00.195 E + 0.36999999999999744
2025-06-29 05:35:00.206 E + 0.3399999999999963
2025-06-29 05:35:00.218 E + 0.35999999999999943
2025-06-29 05:35:00.227 E + 0.3400000000000034
2025-06-29 05:35:00.236 E + 0.35999999999999943
2025-06-29 05:35:00.243 E + 0.37999999999999545
2025-06-29 05:35:00.252 E + sp_name='udr_call':
2025-06-29 05:35:00.265 E + 1.6999999999999997
2025-06-29 05:35:00.276 E + 1.6900000000000004
2025-06-29 05:35:00.286 E + 1.7299999999999995
2025-06-29 05:35:00.295 E + 1.7600000000000007
2025-06-29 05:35:00.302 E + 1.7899999999999991
2025-06-29 05:35:00.308 E + 1.7399999999999984
2025-06-29 05:35:00.314 E + 1.7400000000000002
2025-06-29 05:35:00.321 E + 1.8499999999999979
2025-06-29 05:35:00.327 E + 1.6899999999999977
2025-06-29 05:35:00.335 E + 1.6799999999999997
2025-06-29 05:35:00.347 E + 1.6999999999999993
2025-06-29 05:35:00.356 E + 1.7300000000000004
2025-06-29 05:35:00.363 E + 1.7300000000000004
2025-06-29 05:35:00.373 E + 1.7300000000000004
2025-06-29 05:35:00.387 E + 1.740000000000002
2025-06-29 05:35:00.395 E + 1.730000000000004
2025-06-29 05:35:00.405 E + 1.7199999999999989
2025-06-29 05:35:00.417 E + 1.8100000000000023
2025-06-29 05:35:00.426 E + 1.6899999999999977
2025-06-29 05:35:00.433 E + 1.7000000000000028
2025-06-29 05:35:00.441 E + 1.7199999999999989
2025-06-29 05:35:00.455
2025-06-29 05:35:00.464 tests/bugs/gh_7989_test.py:152: AssertionError
2025-06-29 05:35:00.473 ---------------------------- Captured stdout setup -----------------------------
2025-06-29 05:35:00.486 Creating db: localhost:/var/tmp/qa_2024/test_11659/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.80556, more than threshold: 0.4
E + CPU times for each of 21 measures:
E + sp_name='hash_eval':
E + 0.36
E + 0.3700000000000001
E + 0.3799999999999999
E + 0.3600000000000003
E + 0.35999999999999943
E + 0.4300000000000015
E + 0.41999999999999993
E + 0.370000000000001
E + 0.360000000000003
E + 0.370000000000001
E + 0.35999999999999943
E + 0.370000000000001
E + 0.35999999999999943
E + 0.3500000000000014
E + 0.34999999999999787
E + 0.36999999999999744
E + 0.3399999999999963
E + 0.35999999999999943
E + 0.3400000000000034
E + 0.35999999999999943
E + 0.37999999999999545
E + sp_name='udr_call':
E + 1.6999999999999997
E + 1.6900000000000004
E + 1.7299999999999995
E + 1.7600000000000007
E + 1.7899999999999991
E + 1.7399999999999984
E + 1.7400000000000002
E + 1.8499999999999979
E + 1.6899999999999977
E + 1.6799999999999997
E + 1.6999999999999993
E + 1.7300000000000004
E + 1.7300000000000004
E + 1.7300000000000004
E + 1.740000000000002
E + 1.730000000000004
E + 1.7199999999999989
E + 1.8100000000000023
E + 1.6899999999999977
E + 1.7000000000000028
E + 1.7199999999999989
tests/bugs/gh_7989_test.py:152: AssertionError
|