Commit 74ed2a87 authored by Felix Seibert's avatar Felix Seibert
Browse files

modifying debug output

parent 95170ca4
......@@ -17,6 +17,9 @@ currently only depth (level) 2 subdirectories can be managed
only unix-based OSs are supported
'''
max_processes_change_policy = 200
max_processes_add_replica = 200
max_processes_delete_replica = 50
# TODO add support for arbitrary subdirectory level
# (currently depth=2 is hardcoded, which is fine for GeoMultiSens purposes)
......@@ -203,17 +206,24 @@ class OSDManager(object):
delete_replica_command_list.append(div_util.command_list_to_single_string(delete_command))
# run commands
processes = div_util.run_commands(change_policy_command_list)
start_time = time.time()
processes = div_util.run_commands(change_policy_command_list, max_processes_change_policy)
end_time = time.time()
if self.debug:
print("executing " + str(len(processes)) + " change policy commands done.")
print("executing " + str(len(processes)) + " change policy commands done in " +
str(round(end_time - start_time)) + " sec.")
# div_util.print_process_list(processes)
processes = div_util.run_commands(create_replica_command_list)
start_time = time.time()
processes = div_util.run_commands(create_replica_command_list, max_processes_add_replica)
end_time = time.time()
if self.debug:
print("executing " + str(len(processes)) + " create replica commands done.")
print("executing " + str(len(processes)) + " create replica commands done in " +
str(round(end_time - start_time)) + " sec.")
# div_util.print_process_list(processes)
processes = div_util.run_commands(delete_replica_command_list)
start_time = time.time()
processes = div_util.run_commands(delete_replica_command_list, max_processes_delete_replica)
# run and repeat delete commands, until they return no error
# (if an error is returned for another reason than that one would delete the last complete replica,
......@@ -253,9 +263,13 @@ class OSDManager(object):
if self.debug:
print("rerunning " + str(len(errored_deletions)) + " commands because replica could not be deleted...")
processes = div_util.run_commands(errored_deletions)
processes = div_util.run_commands(errored_deletions, max_processes_change_policy)
iterations += 1
if self.debug:
end_time = time.time()
print("deleting replicas done in in " + str(round(end_time - start_time)) + " sec.")
'''
create empty folders and assign OSDs.
'''
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment