Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
02a7668
Add `instance` label to `Measure`
MadLittleMods Jun 26, 2025
65035b6
Refactor `@measure_func` decorator to include server name
MadLittleMods Jun 26, 2025
d05b6ca
Bulk refactor `Measure(...)` to add `server_name`
MadLittleMods Jun 26, 2025
6731c4b
Refactor `Measure` in `WellKnownResolver`
MadLittleMods Jun 26, 2025
c7d15db
Bulk refactor `@measure_func` decorator usage
MadLittleMods Jun 26, 2025
c232ec7
Fix mypy complaining about unknown types by changing property order a…
MadLittleMods Jun 26, 2025
521c68c
Add changelog
MadLittleMods Jun 26, 2025
652c34b
Better docstrings for `_InFlightMetric` -> `_BlockInFlightMetric`
MadLittleMods Jun 26, 2025
5ad555c
Add docstrings for block metrics
MadLittleMods Jun 26, 2025
06f9af1
Add introduction comment
MadLittleMods Jun 26, 2025
e0f8992
Fix failing to save metrics because of incorrect label names
MadLittleMods Jun 26, 2025
1cb0f77
Add metric docstring to metric description/documentation
MadLittleMods Jul 3, 2025
85293a0
`instance` -> `server_name` label
MadLittleMods Jul 3, 2025
9ef4607
Merge branch 'develop' into madlittlemods/per-hs-metrics-measure3
MadLittleMods Jul 3, 2025
c4abc83
Merge branch 'develop' into madlittlemods/per-hs-metrics-measure3
MadLittleMods Jul 4, 2025
820a8ef
Merge branch 'develop' into madlittlemods/per-hs-metrics-measure3
MadLittleMods Jul 9, 2025
76fbcb7
Merge branch 'develop' into madlittlemods/per-hs-metrics-measure3
MadLittleMods Jul 15, 2025
db172b6
Merge branch 'develop' into madlittlemods/per-hs-metrics-measure3
MadLittleMods Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions synapse/util/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,44 +51,51 @@
"",
labelnames=["block_name", INSTANCE_LABEL_NAME],
)
"""The number of times this block has been called."""

block_timer = Counter(
"synapse_util_metrics_block_time_seconds",
"",
labelnames=["block_name", INSTANCE_LABEL_NAME],
)
"""The cumulative time spent executing this block across all calls, in seconds."""

block_ru_utime = Counter(
"synapse_util_metrics_block_ru_utime_seconds",
"",
labelnames=["block_name", INSTANCE_LABEL_NAME],
)
"""Resource usage: user CPU time in seconds used in this block"""

block_ru_stime = Counter(
"synapse_util_metrics_block_ru_stime_seconds",
"",
labelnames=["block_name", INSTANCE_LABEL_NAME],
)
"""Resource usage: system CPU time in seconds used in this block"""

block_db_txn_count = Counter(
"synapse_util_metrics_block_db_txn_count",
"",
labelnames=["block_name", INSTANCE_LABEL_NAME],
)
"""Number of database transactions completed in this block"""

# seconds spent waiting for db txns, excluding scheduling time, in this block
block_db_txn_duration = Counter(
"synapse_util_metrics_block_db_txn_duration_seconds",
"",
labelnames=["block_name", INSTANCE_LABEL_NAME],
)
"""Seconds spent waiting for database txns, excluding scheduling time, in this block"""

# seconds spent waiting for a db connection, in this block
block_db_sched_duration = Counter(
"synapse_util_metrics_block_db_sched_duration_seconds",
"",
labelnames=["block_name", INSTANCE_LABEL_NAME],
)
"""Seconds spent waiting for a db connection, in this block"""


# This is dynamically created in InFlightGauge.__init__.
Expand Down