synapse/tests/http
Eric Eastwood fc10a5ee29
Refactor Measure block metrics to be homeserver-scoped (v2) (#18601)
Refactor `Measure` block metrics to be homeserver-scoped (add
`server_name` label to block metrics).

Part of https://github.com/element-hq/synapse/issues/18592


### Testing strategy

#### See behavior of previous `metrics` listener

 1. Add the `metrics` listener in your `homeserver.yaml`
    ```yaml
    listeners:
      - port: 9323
        type: metrics
        bind_addresses: ['127.0.0.1']
    ```
1. Start the homeserver: `poetry run synapse_homeserver --config-path
homeserver.yaml`
 1. Fetch `http://localhost:9323/metrics`
1. Observe response includes the block metrics
(`synapse_util_metrics_block_count`,
`synapse_util_metrics_block_in_flight`, etc)


#### See behavior of the `http` `metrics` resource

1. Add the `metrics` resource to a new or existing `http` listeners in
your `homeserver.yaml`
    ```yaml
    listeners:
      - port: 9322
        type: http
        bind_addresses: ['127.0.0.1']
        resources:
          - names: [metrics]
            compress: false
    ```
1. Start the homeserver: `poetry run synapse_homeserver --config-path
homeserver.yaml`
1. Fetch `http://localhost:9322/_synapse/metrics` (it's just a `GET`
request so you can even do in the browser)
1. Observe response includes the block metrics
(`synapse_util_metrics_block_count`,
`synapse_util_metrics_block_in_flight`, etc)
2025-07-15 15:55:23 -05:00
..
federation Refactor Measure block metrics to be homeserver-scoped (v2) (#18601) 2025-07-15 15:55:23 -05:00
server Fix cancellation tests with new Twisted. (#17906) 2024-11-07 15:26:14 +00:00
__init__.py Update license headers 2023-11-21 15:29:58 -05:00
ca.crt
ca.key
server.key
test_additional_resource.py Update license headers 2023-11-21 15:29:58 -05:00
test_client.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_endpoint.py Update license headers 2023-11-21 15:29:58 -05:00
test_matrixfederationclient.py Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
test_proxy.py Remove usage of internal header encoding API (#17894) 2024-11-04 12:20:07 -06:00
test_proxyagent.py Enable flake8-logging and flake8-logging-format rules in Ruff and fix related issues throughout the codebase (#18542) 2025-06-13 09:44:18 +02:00
test_servlet.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_simple_client.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_site.py Don't allow unsupported content-type 2024-12-03 09:53:21 +01:00