mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 18:02:31 +08:00
Add test coverage for profile command
This commit is contained in:
parent
5d84ffe019
commit
ec1fcfba57
@ -475,6 +475,29 @@ def wait_for_database_available(logger):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
|
@enable_logging()
|
||||||
|
def profile(logger):
|
||||||
|
# profile list should return the same list as kill
|
||||||
|
addresses = get_fdb_process_addresses()
|
||||||
|
output1 = run_fdbcli_command('profile', 'list')
|
||||||
|
assert output1.split('\n') == addresses
|
||||||
|
# check default output
|
||||||
|
default_profile_client_get_output = 'Client profiling rate is set to default and size limit is set to default.'
|
||||||
|
output2 = run_fdbcli_command('profile', 'client', 'get')
|
||||||
|
assert output2 == default_profile_client_get_output
|
||||||
|
# TODO: this test is now failing, the implementation needs to be fixed
|
||||||
|
# set rate and size limit
|
||||||
|
# run_fdbcli_command('profile', 'client', 'set', '0.5', 'default')
|
||||||
|
# output3 = run_fdbcli_command('profile', 'client', 'get')
|
||||||
|
# logger.debug(output3)
|
||||||
|
# output3_list = output3.split(' ')
|
||||||
|
# assert float(output3_list[6]) == 0.5
|
||||||
|
# assert output3_list[-1] == '1000000000.'
|
||||||
|
# change back to default value and check
|
||||||
|
run_fdbcli_command('profile', 'client', 'set', 'default', 'default')
|
||||||
|
assert run_fdbcli_command('profile', 'client', 'get') == default_profile_client_get_output
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = ArgumentParser(formatter_class=RawDescriptionHelpFormatter,
|
parser = ArgumentParser(formatter_class=RawDescriptionHelpFormatter,
|
||||||
description="""
|
description="""
|
||||||
@ -512,6 +535,7 @@ if __name__ == '__main__':
|
|||||||
kill()
|
kill()
|
||||||
lockAndUnlock()
|
lockAndUnlock()
|
||||||
maintenance()
|
maintenance()
|
||||||
|
profile()
|
||||||
setclass()
|
setclass()
|
||||||
suspend()
|
suspend()
|
||||||
transaction()
|
transaction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user