Skip to content

Commit

Permalink
CA-399644: log a summary of the snapshot coalesce on completion
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Syms <mark.syms@cloud.com>
  • Loading branch information
MarkSymsCtx committed Oct 25, 2024
1 parent 87f0554 commit 3e4c041
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions drivers/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2039,18 +2039,35 @@ def abortCoalesce(self, prevSize, curSize):

return False

def printReasoning(self):
Util.log("Aborted coalesce")
for hist in self.history:
Util.log(hist)
Util.log(self.reason)
def printSizes(self):
Util.log("Starting size was {size}"
.format(size=self.startSize))
Util.log("Final size was {size}"
.format(size=self.finishSize))
Util.log("Minimum size achieved was {size}"
.format(size=self.minSize))

def printReasoning(self):
Util.log("Aborted coalesce")
for hist in self.history:
Util.log(hist)
Util.log(self.reason)
self.printSizes()

def printSummary(self):
if self.its == 0:
return

if self.reason:
Util.log("Aborted coalesce")
Util.log(self.reason)
else:
Util.log("Coalesce summary")

Util.log(f"Performed {self.its} iterations")
self.printSizes()


def _coalesceLeaf(self, vdi):
"""Leaf-coalesce VDI vdi. Return true if we succeed, false if we cannot
complete due to external changes, namely vdi_delete and vdi_snapshot
Expand All @@ -2064,6 +2081,7 @@ def _coalesceLeaf(self, vdi):
tracker.printReasoning()
raise util.SMException("VDI {uuid} could not be coalesced"
.format(uuid=vdi.uuid))
tracker.printSummary()
return self._liveLeafCoalesce(vdi)

def calcStorageSpeed(self, startTime, endTime, vhdSize):
Expand Down

0 comments on commit 3e4c041

Please sign in to comment.