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 <[email protected]>
  • Loading branch information
MarkSymsCtx committed Oct 17, 2024
1 parent 04473fc commit 26aec0f
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 26aec0f

Please sign in to comment.