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.43
+ 0.3799999999999999
+ 0.3600000000000003
+ 0.35999999999999943
+ 0.3600000000000012
+ 0.34999999999999964
+ 0.46000000000000085
+ 0.34999999999999964
+ 0.41000000000000014
+ 0.370000000000001
+ 0.360000000000003
+ 0.3500000000000014
+ 0.36999999999999744
+ 0.41000000000000014
+ 0.379999999999999
+ 0.370000000000001
+ 0.37000000000000455
+ 0.37000000000000455
+ 0.37000000000000455
+ 0.38000000000000256
+ 0.36999999999999744
+ sp_name='udr_call':
+ 1.68
+ 1.7399999999999998
+ 1.7300000000000004
+ 1.8199999999999994
+ 1.6999999999999993
+ 1.6600000000000001
+ 1.6999999999999993
+ 1.709999999999999
+ 1.6400000000000006
+ 1.6499999999999986
+ 1.7099999999999973
+ 1.7100000000000009
+ 1.7600000000000016
+ 1.7699999999999996
+ 1.6900000000000013
+ 1.6999999999999957
+ 1.7299999999999969
+ 1.6699999999999946
+ 1.6999999999999957
+ 1.6799999999999997
+ 1.8300000000000054
LOG DETAILS:
2025-07-02 05:56:31.136
2025-07-02 05:56:31.144 act = <firebird.qa.plugin.Action object at [hex]>
2025-07-02 05:56:31.150 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-07-02 05:56:31.161
2025-07-02 05:56:31.169 @pytest.mark.version('>=6.0')
2025-07-02 05:56:31.177 def test_1(act: Action, capsys):
2025-07-02 05:56:31.183
2025-07-02 05:56:31.188 with act.db.connect() as con:
2025-07-02 05:56:31.194 cur=con.cursor()
2025-07-02 05:56:31.200 cur.execute('select mon$server_pid as p from mon$attachments where mon$attachment_id = current_connection')
2025-07-02 05:56:31.207 fb_pid = int(cur.fetchone()[0])
2025-07-02 05:56:31.213
2025-07-02 05:56:31.218 times_map = {}
2025-07-02 05:56:31.225 for i in range(0, N_MEASURES):
2025-07-02 05:56:31.231 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-02 05:56:31.238 cur.callproc( 'sp_gen_hash', (N_HASH_EVALUATE_COUNT,) )
2025-07-02 05:56:31.244 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-02 05:56:31.250 times_map[ 'hash_eval', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-02 05:56:31.256
2025-07-02 05:56:31.263 fb_info_init = psutil.Process(fb_pid).cpu_times()
2025-07-02 05:56:31.270 cur.callproc( 'sp_udr_call', (N_UDR_CALLS_COUNT,) )
2025-07-02 05:56:31.277 fb_info_curr = psutil.Process(fb_pid).cpu_times()
2025-07-02 05:56:31.284 times_map[ 'udr_call', i ] = max(fb_info_curr.user - fb_info_init.user, 0.000001)
2025-07-02 05:56:31.290
2025-07-02 05:56:31.295
2025-07-02 05:56:31.302 sp_gen_hash_median = median([v for k,v in times_map.items() if k[0] == 'hash_eval'])
2025-07-02 05:56:31.308 sp_udr_call_median = median([v for k,v in times_map.items() if k[0] == 'udr_call'])
2025-07-02 05:56:31.314
2025-07-02 05:56:31.320 median_ratio = sp_udr_call_median / sp_gen_hash_median
2025-07-02 05:56:31.326
2025-07-02 05:56:31.335 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-02 05:56:31.343 if median_ratio > MAX_RATIO:
2025-07-02 05:56:31.354 print(f'CPU times for each of {N_MEASURES} measures:')
2025-07-02 05:56:31.365 for sp_name in ('hash_eval', 'udr_call', ):
2025-07-02 05:56:31.376 print(f'{sp_name=}:')
2025-07-02 05:56:31.386 for p in [v for k,v in times_map.items() if k[0] == sp_name]:
2025-07-02 05:56:31.395 print(p)
2025-07-02 05:56:31.406
2025-07-02 05:56:31.416 act.expected_stdout = expected_stdout
2025-07-02 05:56:31.423 act.stdout = capsys.readouterr().out
2025-07-02 05:56:31.430 > assert act.clean_stdout == act.clean_expected_stdout
2025-07-02 05:56:31.437 E AssertionError: assert
2025-07-02 05:56:31.445 E - Medians ratio: acceptable
2025-07-02 05:56:31.454 E + Medians ratio: /* perf_issue_tag */ POOR: 4.59459, more than threshold: 0.4
2025-07-02 05:56:31.467 E + CPU times for each of 21 measures:
2025-07-02 05:56:31.477 E + sp_name='hash_eval':
2025-07-02 05:56:31.484 E + 0.43
2025-07-02 05:56:31.490 E + 0.3799999999999999
2025-07-02 05:56:31.495 E + 0.3600000000000003
2025-07-02 05:56:31.500 E + 0.35999999999999943
2025-07-02 05:56:31.505 E + 0.3600000000000012
2025-07-02 05:56:31.510 E + 0.34999999999999964
2025-07-02 05:56:31.517 E + 0.46000000000000085
2025-07-02 05:56:31.523 E + 0.34999999999999964
2025-07-02 05:56:31.532 E + 0.41000000000000014
2025-07-02 05:56:31.540 E + 0.370000000000001
2025-07-02 05:56:31.547 E + 0.360000000000003
2025-07-02 05:56:31.555 E + 0.3500000000000014
2025-07-02 05:56:31.563 E + 0.36999999999999744
2025-07-02 05:56:31.571 E + 0.41000000000000014
2025-07-02 05:56:31.579 E + 0.379999999999999
2025-07-02 05:56:31.587 E + 0.370000000000001
2025-07-02 05:56:31.595 E + 0.37000000000000455
2025-07-02 05:56:31.603 E + 0.37000000000000455
2025-07-02 05:56:31.611 E + 0.37000000000000455
2025-07-02 05:56:31.622 E + 0.38000000000000256
2025-07-02 05:56:31.636 E + 0.36999999999999744
2025-07-02 05:56:31.646 E + sp_name='udr_call':
2025-07-02 05:56:31.654 E + 1.68
2025-07-02 05:56:31.661 E + 1.7399999999999998
2025-07-02 05:56:31.673 E + 1.7300000000000004
2025-07-02 05:56:31.686 E + 1.8199999999999994
2025-07-02 05:56:31.696 E + 1.6999999999999993
2025-07-02 05:56:31.703 E + 1.6600000000000001
2025-07-02 05:56:31.710 E + 1.6999999999999993
2025-07-02 05:56:31.717 E + 1.709999999999999
2025-07-02 05:56:31.723 E + 1.6400000000000006
2025-07-02 05:56:31.732 E + 1.6499999999999986
2025-07-02 05:56:31.745 E + 1.7099999999999973
2025-07-02 05:56:31.752 E + 1.7100000000000009
2025-07-02 05:56:31.765 E + 1.7600000000000016
2025-07-02 05:56:31.778 E + 1.7699999999999996
2025-07-02 05:56:31.789 E + 1.6900000000000013
2025-07-02 05:56:31.802 E + 1.6999999999999957
2025-07-02 05:56:31.813 E + 1.7299999999999969
2025-07-02 05:56:31.823 E + 1.6699999999999946
2025-07-02 05:56:31.831 E + 1.6999999999999957
2025-07-02 05:56:31.838 E + 1.6799999999999997
2025-07-02 05:56:31.845 E + 1.8300000000000054
2025-07-02 05:56:31.851
2025-07-02 05:56:31.859 tests/bugs/gh_7989_test.py:152: AssertionError
2025-07-02 05:56:31.871 ---------------------------- Captured stdout setup -----------------------------
2025-07-02 05:56:31.881 Creating db: localhost:/var/tmp/qa_2024/test_11663/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.43
E + 0.3799999999999999
E + 0.3600000000000003
E + 0.35999999999999943
E + 0.3600000000000012
E + 0.34999999999999964
E + 0.46000000000000085
E + 0.34999999999999964
E + 0.41000000000000014
E + 0.370000000000001
E + 0.360000000000003
E + 0.3500000000000014
E + 0.36999999999999744
E + 0.41000000000000014
E + 0.379999999999999
E + 0.370000000000001
E + 0.37000000000000455
E + 0.37000000000000455
E + 0.37000000000000455
E + 0.38000000000000256
E + 0.36999999999999744
E + sp_name='udr_call':
E + 1.68
E + 1.7399999999999998
E + 1.7300000000000004
E + 1.8199999999999994
E + 1.6999999999999993
E + 1.6600000000000001
E + 1.6999999999999993
E + 1.709999999999999
E + 1.6400000000000006
E + 1.6499999999999986
E + 1.7099999999999973
E + 1.7100000000000009
E + 1.7600000000000016
E + 1.7699999999999996
E + 1.6900000000000013
E + 1.6999999999999957
E + 1.7299999999999969
E + 1.6699999999999946
E + 1.6999999999999957
E + 1.6799999999999997
E + 1.8300000000000054
tests/bugs/gh_7989_test.py:152: AssertionError
|