Commit 62b2626c authored by Felix Seibert's avatar Felix Seibert
Browse files

print total size of moved folder size when rebalancing in debug mode

parent 815341e2
......@@ -233,6 +233,12 @@ class OSDManager(object):
print("movements:")
print(str(movements))
total_movement_size = 0
for folder_id in movements:
total_movement_size += self.distribution.get_folder_size(folder_id)
print("total movement size: " + str(total_movement_size))
print("rebalanced osd manager: \n" + str(self))
new_assignments = list(map(lambda key, value : (key, value[1]), list(movements.items())))
......
......@@ -97,6 +97,11 @@ class DataDistribution(object):
return checked_osd
return None
def get_folder_size(self, folder_id):
containing_osd = self.get_containing_osd(folder_id)
assert containing_osd is not None
return containing_osd.get_folder_size(folder_id)
def assign_new_osd(self, folder_id, new_osd):
"""
assign folder_id to new_osd. if folder_id already is assigned to an OSD, this old assignment is deleted.
......
......@@ -56,6 +56,10 @@ class OSD(object):
def get_processing_time(self):
return self.total_folder_size / self.bandwidth
def get_folder_size(self, folder_id):
assert folder_id in self.folders
return self.folders[folder_id]
def __str__(self):
return "osd: '" + self.uuid \
+ "' totalFolderSize: " + str(self.total_folder_size) \
......
Markdown is supported
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