0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 08:23:47 +01:00

Use the transaction 'desc' rather than 'name', increment the txn_ids in

txn names
This commit is contained in:
Mark Haines 2015-02-09 18:06:31 +00:00
parent 347b497db0
commit 0c4536da8f

View file

@ -140,7 +140,7 @@ class SQLBaseStore(object):
with LoggingContext("runInteraction") as context:
current_context.copy_to(context)
start = time.time() * 1000
txn_id = SQLBaseStore._TXN_ID
txn_id = self._TXN_ID
# We don't really need these to be unique, so lets stop it from
# growing really large.
@ -163,10 +163,10 @@ class SQLBaseStore(object):
self._current_txn_total_time += end - start
count, cum_time = self._txn_perf_counters.get(name, (0,0))
count, cum_time = self._txn_perf_counters.get(desc, (0,0))
count += 1
cum_time += end - start
self._txn_perf_counters[name] = (count, cum_time)
self._txn_perf_counters[desc] = (count, cum_time)
with PreserveLoggingContext():
result = yield self._db_pool.runInteraction(