def METHOD_NAME(executor, port_generator):
    port0 = port_generator()
    port1 = port_generator()
    with Flow(monitoring=True, port_monitoring=port0).add(
        uses=executor, port_monitoring=port1
    ) as f:
        f.post('/foo', inputs=DocumentArray.empty(size=1))
        raw_metrics_executor = req.get(f'http://localhost:{port1}/').content.decode()
        raw_metrics_gateway = req.get(f'http://localhost:{port0}/').content.decode()
    metrics_executor = get_metric_values(raw_metrics_executor)
    metrics_gateway = get_metric_values(raw_metrics_gateway)
    assert (
        metrics_gateway['jina_request_size_bytes_sum{runtime_name="gateway/rep-0"}']
        == metrics_gateway[
            'jina_received_request_bytes_sum{runtime_name="gateway/rep-0"}'
        ]
    )
    assert (
        metrics_executor[
            'jina_request_size_bytes_sum{executor="DummyExecutor",executor_endpoint="/foo",runtime_name="executor0/rep-0"}'
        ]
        == metrics_executor[
            'jina_received_request_bytes_sum{executor="DummyExecutor",executor_endpoint="/foo",runtime_name="executor0/rep-0"}'
        ]
    )