summary refs log tree commit diff
path: root/synapse/state
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-06-18 13:01:52 +0100
committerErik Johnston <erik@matrix.org>2019-06-18 13:02:06 +0100
commit16a3124b767a851e219777464a694b04dcc1aae7 (patch)
treecc57188b428d72f3612049e66c14ccb136948f39 /synapse/state
parentUse consistent buckets (diff)
downloadsynapse-16a3124b767a851e219777464a694b04dcc1aae7.tar.xz
Only count non-cache state resolution
Diffstat (limited to 'synapse/state')
-rw-r--r--synapse/state/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py
index 8099297cfe..b914a5ba03 100644
--- a/synapse/state/__init__.py
+++ b/synapse/state/__init__.py
@@ -41,7 +41,7 @@ logger = logging.getLogger(__name__)
 # Metrics for number of state groups involved in a resolution.
 state_groups_histogram = Histogram(
     "synapse_state_number_state_groups", "",
-    buckets=(0, 1, 2, 3, 5, 7, 10, 15, 20, 50, 100, 200, 500, "+Inf"),
+    buckets=(1, 2, 3, 5, 7, 10, 15, 20, 50, 100, 200, 500, "+Inf"),
 )
 
 
@@ -372,8 +372,6 @@ class StateHandler(object):
             room_id, event_ids
         )
 
-        state_groups_histogram.observe(len(state_groups_ids))
-
         if len(state_groups_ids) == 0:
             defer.returnValue(_StateCacheEntry(
                 state={},
@@ -498,6 +496,8 @@ class StateResolutionHandler(object):
                 "Resolving state for %s with %d groups", room_id, len(state_groups_ids)
             )
 
+            state_groups_histogram.observe(len(state_groups_ids))
+
             # start by assuming we won't have any conflicted state, and build up the new
             # state map by iterating through the state groups. If we discover a conflict,
             # we give up and instead use `resolve_events_with_store`.