From 36e08c98458cb22516ad8dba580903335d969da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 6 Sep 2023 17:23:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20Add=20=20performance=20timer=20t?= =?UTF-8?q?o=20getters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/settings/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/octoprint/settings/__init__.py b/src/octoprint/settings/__init__.py index 8685a6e5c..bee0d11eb 100644 --- a/src/octoprint/settings/__init__.py +++ b/src/octoprint/settings/__init__.py @@ -41,6 +41,7 @@ from octoprint.util import ( fast_deepcopy, generate_api_key, is_hidden_path, + time_this, yaml, ) @@ -255,6 +256,11 @@ class HierarchicalChainMap: prefix = key + _CHAINMAP_SEP return key in current or any(map(lambda x: x.startswith(prefix), current.keys())) + @time_this( + logtarget="octoprint.settings.timings.HierarchicalChainMap.get_by_path", + message="{func}({func_args}) took {timing:.6f}ms", + incl_func_args=True, + ) def get_by_path(self, path, only_local=False, only_defaults=False, merged=False): if only_defaults: current = self._chainmap.parents