diff options
author | Erik Johnston <erik@matrix.org> | 2014-10-28 10:53:11 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-10-28 10:53:11 +0000 |
commit | 967ce43b59e90f36c21f3a493bc81ab4e57dae69 (patch) | |
tree | 2af50601fca53d98d926a59da3fd6349124f6628 /synapse/storage | |
parent | Add timer to LoggingTransaction (diff) | |
download | synapse-967ce43b59e90f36c21f3a493bc81ab4e57dae69.tar.xz |
Clean up LoggingTransaction
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/_base.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index e839704a8c..d3e8741889 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -39,14 +39,11 @@ class LoggingTransaction(object): def __init__(self, txn): object.__setattr__(self, "txn", txn) - def __getattribute__(self, name): - if name == "execute": - return object.__getattribute__(self, "execute") - - return getattr(object.__getattribute__(self, "txn"), name) + def __getattr__(self, name): + return getattr(self.txn, name) def __setattr__(self, name, value): - setattr(object.__getattribute__(self, "txn"), name, value) + setattr(self.txn, name, value) def execute(self, sql, *args, **kwargs): # TODO(paul): Maybe use 'info' and 'debug' for values? @@ -60,12 +57,9 @@ class LoggingTransaction(object): # Don't let logging failures stop SQL from working pass - # TODO(paul): Here would be an excellent place to put some timing - # measurements, and log (warning?) slow queries. - start = time.clock() * 1000 try: - return object.__getattribute__(self, "txn").execute( + return self.txn.execute( sql, *args, **kwargs ) finally: |