From 60939d220bea81ff1af587cbe65b4a5777d446c1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Aug 2019 16:58:13 +0200 Subject: [PATCH] Log time it takes to add container tree for a printer It's useful to know, at least while we're building this. Contributes to issue CURA-6600. --- cura/Machines/ContainerTree.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/Machines/ContainerTree.py b/cura/Machines/ContainerTree.py index 1b71a5e5f8..4299003b16 100644 --- a/cura/Machines/ContainerTree.py +++ b/cura/Machines/ContainerTree.py @@ -68,8 +68,10 @@ class ContainerTree: continue # Only want to load global stacks. We don't need to create a tree for extruder definitions. definition_id = stack.definition.getId() if definition_id not in self.machines: + definition_start_time = time.time() self.machines[definition_id] = MachineNode(definition_id) self.machines[definition_id].materialsChanged.connect(self.materialsChanged) + Logger.log("d", "Adding container tree for {definition_id} took {duration} seconds.".format(definition_id = definition_id, duration = time.time() - definition_start_time)) Logger.log("d", "Building the container tree took %s seconds", time.time() - start_time) @@ -83,5 +85,7 @@ class ContainerTree: if definition_id in self.machines: return # Already have this definition ID. + start_time = time.time() self.machines[definition_id] = MachineNode(definition_id) - self.machines[definition_id].materialsChanged.connect(self.materialsChanged) \ No newline at end of file + self.machines[definition_id].materialsChanged.connect(self.materialsChanged) + Logger.log("d", "Adding container tree for {definition_id} took {duration} seconds.".format(definition_id = definition_id, duration = time.time() - start_time)) \ No newline at end of file