summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2023-06-07 18:12:23 +0100
committerGitHub <noreply@github.com>2023-06-07 17:12:23 +0000
commitd162aecaac52fb467822e319e4c3c5b216c33ca9 (patch)
tree8a92ee76319fb5ed9f0c26de7df0067758b46296 /synapse/storage/database.py
parentRemove superfluous `room_memberships` join from background update (#15733) (diff)
downloadsynapse-d162aecaac52fb467822e319e4c3c5b216c33ca9.tar.xz
Quick & dirty metric for background update status (#15740)
* Quick & dirty metric for background update status

* Changelog

* Remove debug

Co-authored-by: Mathieu Velten <mathieuv@matrix.org>

* Actually write to _aborted

---------

Co-authored-by: Mathieu Velten <mathieuv@matrix.org>
Diffstat (limited to '')
-rw-r--r--synapse/storage/database.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py
index bdaa508dbe..10fa6c4802 100644
--- a/synapse/storage/database.py
+++ b/synapse/storage/database.py
@@ -54,7 +54,7 @@ from synapse.logging.context import (
     current_context,
     make_deferred_yieldable,
 )
-from synapse.metrics import register_threadpool
+from synapse.metrics import LaterGauge, register_threadpool
 from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.storage.background_updates import BackgroundUpdater
 from synapse.storage.engines import BaseDatabaseEngine, PostgresEngine, Sqlite3Engine
@@ -547,6 +547,12 @@ class DatabasePool:
         self._db_pool = make_pool(hs.get_reactor(), database_config, engine)
 
         self.updates = BackgroundUpdater(hs, self)
+        LaterGauge(
+            "synapse_background_update_status",
+            "Background update status",
+            [],
+            self.updates.get_status,
+        )
 
         self._previous_txn_total_time = 0.0
         self._current_txn_total_time = 0.0