Mercurial > code > home > repos > homeauto
diff service/mqtt_to_rdf/inference.py @ 1697:88f6e9bf69d1
stats and non-debug mode speedups
author | drewp@bigasterisk.com |
---|---|
date | Tue, 28 Sep 2021 00:32:16 -0700 |
parents | cdf706cf5f82 |
children |
line wrap: on
line diff
--- a/service/mqtt_to_rdf/inference.py Mon Sep 27 22:56:25 2021 -0700 +++ b/service/mqtt_to_rdf/inference.py Tue Sep 28 00:32:16 2021 -0700 @@ -164,7 +164,9 @@ fullBinding: CandidateBinding = self._prevBindings().copy() fullBinding.addNewBindings(newBinding) isNew = fullBinding not in self._seenBindings - ringlog.debug(f'{INDENT*7} {self} considering {newBinding=} to make {fullBinding}. {isNew=}') + + if ringlog.isEnabledFor(logging.DEBUG): + ringlog.debug(f'{INDENT*7} {self} considering {newBinding=} to make {fullBinding}. {isNew=}') # if self.slog: # self.slog.looperConsider(self, newBinding, fullBinding, isNew) @@ -326,6 +328,7 @@ raise NotImplementedError(f'trying too many permutations {len(chunks)=}') permsTried += 1 + stats['permsTried'] += permsTried odolog.debug(f'{INDENT*5} no perms worked- rule cannot match anything') raise NoOptions()