summaryrefslogtreecommitdiff
path: root/obnamlib/fmt_ga/cowtree.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-06-24 17:26:58 +0300
committerLars Wirzenius <liw@liw.fi>2017-06-24 17:26:58 +0300
commit1d1d2fcfbf2af0e0738073898f91de03e3fccf28 (patch)
tree437423ec47006dcf675ce739109312bd1917b416 /obnamlib/fmt_ga/cowtree.py
parentd9bdb11d7d89945b2e43d54e8e4ed6e2a4b172ee (diff)
downloadobnam-1d1d2fcfbf2af0e0738073898f91de03e3fccf28.tar.gz
Add: trace statements for leaf put/get/remove
Diffstat (limited to 'obnamlib/fmt_ga/cowtree.py')
-rw-r--r--obnamlib/fmt_ga/cowtree.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/obnamlib/fmt_ga/cowtree.py b/obnamlib/fmt_ga/cowtree.py
index dbfdcf81..c507fca3 100644
--- a/obnamlib/fmt_ga/cowtree.py
+++ b/obnamlib/fmt_ga/cowtree.py
@@ -16,6 +16,9 @@
# =*= License: GPL-3+ =*=
+import tracing
+
+
import obnamlib
@@ -74,6 +77,7 @@ class CowTree(object):
yield key
def commit(self):
+ tracing.trace('start comitting')
keys = sorted(self.keys())
leaf = obnamlib.CowLeaf()
leaf_list = obnamlib.LeafList()
@@ -86,7 +90,10 @@ class CowTree(object):
if len(leaf) > 0:
self._add_leaf(leaf_list, leaf)
leaf_id = self._put_leaf_list(leaf_list)
+ tracing.trace('commit: remove old tree')
self._remove_old_tree(self._leaf_list)
+ tracing.trace('finish committing')
+ self.set_list_node(leaf_id)
return leaf_id
def _add_leaf(self, leaf_list, leaf):
@@ -102,5 +109,7 @@ class CowTree(object):
return list_id
def _remove_old_tree(self, leaf_list): # pragma: no cover
+ tracing.trace('start removing old cowtree')
for leaf_id in leaf_list.leaves():
self._store.remove_leaf(leaf_id)
+ tracing.trace('finished removing old cowtree')